Reputation: 2249
I have a ViewController that is listening to the UIApplicationWillResignActiveNotification. I have therefore a method that fires when that notification comes.
The thing is that I want to differentiate between these two notifications:
1) app will resign active due to the home button being pressed and the app is not visible
2) app will resign active due to for example an in app purchase alert view, or the user opening the control center or the notification view from the top.
In case 1) I want to "reset" the VC.
In case 2) I do not want to "reset" the VC.
Is there a way to differentiate between those 2 cases?
Upvotes: 0
Views: 584
Reputation: 6952
As the view controller should be reset in case 1, I guess it should be reset after a long interval time in the background. So I think it is a good place to do that in - (void)applicationWillEnterForeground:(UIApplication *)application
.
To the problem that vc being dismissed when reset, I think there must be a way to work around it, it depends on how you implements the "reset".
Upvotes: 1