Making a password lock for an app?

北城以北 提交于 2019-11-30 18:02:07

问题


I'm wanting to make a password unlock screen for my app, and I'm not sure how I'd go about it.

I'm wanting it to look like the Apple-designed version of it, which is the passcode lock setting screen.

How might I go about doing something like this, where as soon as all four digits are entered the code is immediately checked against a pre-set password?

Thanks!


回答1:


most likely you create the view and when all the fields are set you check against the known password or you check the hash of the input passkey against the hash you have stored.

basically you have a stored password/hash and you check against that when you have all field filled in in your view.

when the password is correct (either by hash checking or password) you show your next view, otherwise you display an error saying the password is incorrect.




回答2:


Just found a project that replicates this perfectly. I'm going to post this here for future reference in case anyone needs it. https://github.com/guicocoa/pinview




回答3:


Here is another library, just in case someone is looking for something like this: http://cocoacontrols.com/platforms/ios/controls/abpadlockscreen




回答4:


iOS 7 style Passcode. Complete functional demo with great documentation showing the different states (i.e Enable, Test, Change & Turn Off)

https://github.com/rolandleth/LTHPasscodeViewController



来源:https://stackoverflow.com/questions/4048894/making-a-password-lock-for-an-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!