KeyLock v1.0 iPhone iOS5 App
The project and code itself are well commented inside the project so you shouldn’t have much trouble customize it the way you like.
Features
Quartz 2D based
Delegate driven (easy to use)
Customizable background image
Supports any complexity pattern
Unlock screen
The unlock screen subclass UIView and utilize Quartz 2D for drawing circles, lines etc. The unlock screen takes a delegate and let the delegate handle pattern validation and persistence. The idea is that the unlock screen should be easy to use and still flexible.
The unlock view defines a simple delegate protocol which is used for validating combination input.
The drawing is pretty straight forward. Quartz 2D is a very competent drawing engine when working with application style UI. The most complex part of drawing the interface is the directional arrows (red triangles). Hopefully the code comments explain clearly enough what’s going on!
Using the unlock screen
My sample application demonstrate how to use the unlock screen to both record a pattern and validate a pattern). The “password” or pattern used to unlock is easily stored into the application settings as well as the number of attempts to authenticate. By utilizing a delegate the same unlock screen code can be used to both record a pattern and to validate it. The “deemKeyCombinationInvalid” function turns the circles red, informing the user that the pattern is invalid.
NOTE
The included padlock icon image comes from http://www.glyphish.com. Check them out, their icons are awesome!
Best regards!
Martin