antiraum / THPinViewController

iOS 7 Style PIN Screen for iPhone and iPad

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use with iPad UISplitViewController

Sun3 opened this issue · comments

commented

Any suggestions on how to get the Passcode PIN View to show up from a UISplitViewController AppDelegate?

I am using below code but it never shows up.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self.window.rootViewController presentViewController:pinViewController animated:YES completion:nil];
...

Any suggestions are appreciated.

commented

I fixed this by presenting the pinViewController in the - (void)applicationDidBecomeActive:(UIApplication *)application and the animated:NO.

Next issue is when the user closes the app by tapping the Home Button and them comes back you can see the current screen that they were working on then the pinViewController shows up.

Is there a way to show the pinViewController first so that the sensitive data is not shown? Is there a different place to place this in the AppDelegate? I have many different views and I really do not want to place Passcode Logic in each UIViewController.

Thank you.

To protect sensitive content when the app is closed, present the lock screen when the UIApplicationDidEnterBackgroundNotification is posted.

This also ensures that no sensitive content is visible in the app switches screenshot.

commented

@antiraum Yea, I have tried using the applicationDidEnterBackground in the AppDelegate but when I re-open the app you can still see the apps data. I traced it and the code is being run to call the presentViewController but at this point I am assuming it is not being added.

Thanks.

Have you tested this on a real device? This doesn't work properly on the simulator. I have extended the example app to show how to lock when the app enters the background.

commented

@antiraum Yep, that was it. I kept testing on the simulator but it works great on the device...

Thank you so much for the help it is appreciated and you do have a great control.