0
votes

How can I change to another view when the app is opened again.

I was thinking of using the method ' - (void)applicationWillEnterForeground:(UIApplication *)application ' in my app delegate and performing a segue maybe? How would I go about doing this correctly?

Thanks guys!

1

1 Answers

1
votes

u can use NSUserDeafult to add the status of application when its go in foreground and when application opened again means in "application didFinishLaunchingWithOptions" just check that NSUserDeafult's value and change ur view.

  NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];

  // saving an NSString
  [prefs setObject:@"first" forKey:@"state"];
  [prefs synchronize];

use this code when application go in foreground

and when its come back just

NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];

// getting an NSString
NSString *state = [prefs stringForKey:@"state"];

now according to state do whatever u want