0

A scree is the first page when the application launches. The user can only click on the accept & continue button to proceed. This page only appears once initially & when the user had clicked on the accept & continue button, this page doesn’t appear in subsequent launch of this application. Only when the user has wiped clean all data related to this application does this page appear on startup again.

Sergey Grischyov
  • 11,995
  • 20
  • 81
  • 120
Sport
  • 8,570
  • 6
  • 46
  • 65

5 Answers5

1
  1. Create one view controller. And, load it at the start of the app.
  2. When user click on "accept & continue", go ahead and save one BOOL value in Plist, NSUserDefault.
  3. When you load the app next time check this value and show the screen depending on BOOL value you have saved.
  4. Do the same thing when user has clear the data.
Rushi
  • 4,553
  • 4
  • 33
  • 46
0

It seems that you are talking about splash screen. If you want some custom buttons like accept and continue, you can create a custom view and call that view from AppDelegate's didFinishLaunching method. On button click you can add respective methods.

parilogic
  • 1,147
  • 9
  • 26
0
 if ([[NSUserDefaults standardUserDefaults] boolForKey:IS_FIRST_LOGIN])
{
    showYourPage();
}
#########In your Page#######
-(void) acceptButtonClicked
{
    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:IS_FIRST_LOGIN];
}
Scott Zhu
  • 8,341
  • 6
  • 31
  • 38
  • i used this logic inside the viewDidLoad but its not working showing Warning: Attempt to present on whose view is not in the window hierarchy! – Sport Sep 10 '13 at 12:12
0

You can use NSUserDefaults

//When launched for the first time set value like this :

[[NSUserDefaults standardUserDefaults] setValue:@"YES" forKey:@"LaunchingFirstTime"];

after that

NSString *launch = [[NSUserDefaults standardUserDefaults]valueForKey:@"LaunchingFirstTime"];

if([launch isEqualToString:@"YES"]){
    //Don't Show Screen
}
else{
    //Show Screen
}

Hope this will help you

Prashant Nikam
  • 2,253
  • 4
  • 17
  • 29
  • Xman i used this logic- (void)viewDidLoad welcomePage *temp = [[welcomePage alloc]initWithNibName:@"welcomePage" bundle:nil]; [self presentViewController:temp animated:YES completion:^(void){}]; } else{ NSLog(@"screen"); } but its showing Warning: Attempt to present on whose view is not in the window hierarchy! and welcome screen did not come – Sport Sep 10 '13 at 11:36
  • @Ram : that is diffrent issue.. – Prashant Nikam Sep 10 '13 at 13:53
  • this logic is working but when did i quite the apps and again its coming – Sport Sep 11 '13 at 05:56
  • NSUserDefaults might not have a chance to save depending on how the process is terminated. check this [old question](http://stackoverflow.com/q/2622754/2407907) – Prashant Nikam Sep 11 '13 at 06:02
0

you can do it like this

self.userDefaults = [NSUserDefaults standardUserDefaults];
NSString *str = [self.userDefaults valueForKey:@"SecondLaunch"];
NSLog(@"the string value is : %@",str);

if ([str isEqualToString:@"Second"]) {
    NSLog(@"It's Second Launch");
} else {
    NSLog(@"It's First Launch");
    [self.userDefaults setObject:@"Second" forKey:@"SecondLaunch"];
    [self.userDefaults synchronize];        
}
D-eptdeveloper
  • 2,430
  • 1
  • 16
  • 30