Kex
Kex

Reputation: 8629

How do I detect if a view appeared from the app being restored?

I am having trouble figuring out how to do this. I know I can use -(void)viewWillAppear for when an app is open to detect if the view is open or not. I want to Call code in my view when the app is restored and if the view is open, can anyone give me any pointers on how to do this please?

Upvotes: 0

Views: 72

Answers (1)

LoVo
LoVo

Reputation: 2083

You could implement the methods

- (void)applicationDidEnterBackground:(UIApplication *)application;
- (void)applicationWillEnterForeground:(UIApplication *)application;
- (void)applicationDidBecomeActive:(UIApplication *)application;
- (void)applicationWillResignActive:(UIApplication *)application;

in the AppDelegate to check if the app was restarted or is going to be closed.

Upvotes: 2

Related Questions