Alexj17
Alexj17

Reputation: 31

When Open From Background

I see the delegate has the 'didFinishLaunchingWithOptions' for when the first app first loads. I know each page has the DidLoad and WillAppear.

Is there a method/function/class or whatever these things are called for when the app is opened while it is in the background. Either the user clicks it from the bottom row of icons (after double click) or simply just clicks the app icon when it is already open.

I dont want to use the WillAppear because then it will happen on every page view and not just this reload from background.

Thanks Alex

Upvotes: 1

Views: 111

Answers (1)

Ermiar
Ermiar

Reputation: 1077

If you want catch the fact that your app is bring to foreground you should use the UIApplication delegate protocol that give you this method :

- (void)applicationWillEnterForeground:(UIApplication *)application

This is sent just before the application is bring to foreground and you can do what you want at this moment.

Be careful, this only works since iOS 4.0, you should add this method in your application delegate class after your - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions.

Hope this helps !

Upvotes: 1

Related Questions