I’m trying to build a security app that prompts the user to enter a passcode before allowing access to the application. This is done on the first launch or when the application is resumed.
Right now, I’m using a view controller, PasscodeViewController, which is presented modally on application launch or resume, i.e., in the app delegate:
- (void)applicationDidBecomeActive:(UIApplication *)application
{
if (!self.passcodeViewController.view.window)
[self.window.rootViewController presentViewController:self.passcodeViewController animated:NO completion:NULL];
}
The problem is that the main view controller’s view is flashed momentarily before the PasscodeViewController is presented. This is a security risk because the user can quickly get a glimpse of the data before being asked to enter a passcode.
How do you solve this? How do programs like DotLockData, and other security programs, implement such a feature?
Seems it would be better to do that sort of thing on suspend rather than resume. Perhaps in
applicationWillResignActive