IPhone iOS, how to add a PIN / password lock screen when the application resumes from the background?

I need to add a 4-digit checkpoint controller that will β€œhang” over the main window of my application and not allow users who do not know the PIN code when viewing data in the application.

I am wondering if there are any demo projects or open source projects that perform this function (key clicks, auto focus change, static glossy keyboard display, lock after x seconds).

Thanks for your input!

+4
source share
2 answers

By creating my own custom notification view, the following is a tutorial, I was able to create a PIN view that covers the entire window, thus absorbing all the input. Then I put the code in applicationWillResignActive and applicationDidBecomeActive to determine how long the application has been minimized, to present a PIN input window based on user preferences. Do not forget that you want to store PIN safely, I recommend using the built-in key fob.

+2
source

not sure about any demo applications, but you have hooks for this, for example ...

application delegates application WillEnterForeground 'and' applicationDidBecomeActive '

It may also matter if your application is turned on in the background or not, how you intend to implement it.

In my application, I have a setting for navigating the user to the main screen at any time when the application becomes active / goes to the forefront. The main screen controller then determines whether the user will still be logged in / active, and if he does not push the stack entry controller.

+5
source

All Articles