Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone iOS how to add pin/passcode lock screen when app resumes from background?

I need to add a 4 digit pin view controller that would "hover" over my app's main window and prevent users who do not know the pin from browsing data within the app.

I'm interested if there are any demo projects or open source projects that accomplish this functionality (key clicks, automatically changing focus, displaying a static glossy keyboard, lock after x amount of seconds).

Thank you for your input!

like image 943
Alex Stone Avatar asked Jul 10 '12 16:07

Alex Stone


1 Answers

not sure of any demo apps, but you have hooks to do this like...

app delegates 'applicationWillEnterForeground' and 'applicationDidBecomeActive'

also might matter if your app is enabled to run in background or not how you go about implementing it.

In my app I have it set up to navigate the user to home screen anytime the app becomes active/enters foreground. The home screen controller then determines if the user is still logged in/active and if they aren't it pushes a login view controller on the stack.

like image 155
Augie Avatar answered Nov 10 '22 00:11

Augie