I am working an app where lock option is included.My app starts with passcode screen.If I enter correct code then it navigates to next screen.If I dont use the app for long time it goes to sleep mode.When the user wants to run the app now, the passcode screen should appear and the user has to enter the code again.Is it possible?Is there any tutorial for this?Please dont mind to post the related code if you have done it.Thanks in advance.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- What is the best way to create a lock from a web a
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
I have developed same type of apps, where I have implemented this things, For this I made a one Class like this
And
Just import this class to every ViewController And put this code to
And When Application Goes in Background
Thanks..
check in app delegate class there the methods
applicationDidEnterForeground
andapplicationDidEnterBackground
are available do your coding thereYou can detect when your app goes to the background using the
UIApplicationDidEnterBackgroundNotification
. When it does, record the date and time. When the user opens the app back up, you will receiveUIApplicationWillEnterForegroundNotification
. When you receive that, compare the recorded date and time with the current date and time. If that's too old, display the passcode screen.Yes ofcourse it is possible. You must open the screen in a method called
applicationDidBecomeActive
in your Application Delegate. This method is called every time the application is opened from background.So whenever the user starts the already running app, this method will be called and from this you can first show the Password screen, and after that the respective screen.