I want to block users from my application after a period of being in the background. I will catch this in the AppDelegate applicationWillEnterForeground (and compare the time stored in applicationWillResignActive ). If less than the waiting period, no action occurs. If more than the timeout, I call:
[_navigationController popToRootViewControllerAnimated:NO]
which returns the user to root mode.
It works great with one visual interrupt. The previous view (that which the user viewed when the application is inactive) appears very briefly before appearing in the root. When testing, it seems that the view appears again before calling applicationWillEnterForeground .
The only thing I had was to hide everything before going inactive, for example, by shading the view with a filled rectangle. It smells like a dirty hack, so I think there is a better way.
I am also open to different ways to achieve the same end result. Thanks!
Mitch cohen
source share