Skip to content

mdaisuke/LTHPasscodeViewController

 
 

Repository files navigation

LTHPasscodeViewController

Simple to use iOS 7 style (replica, if you will) Passcode view. Not the Lock Screen one, but the one you get in Settings when changing your passcode. I made it a singleton because if the lock is active, when leaving the app a view must be placed on top, so no data from within the app can be seen in the multitasking mode. This is done under the hood, without having to do anything extra.

How to use

Drag the contents of LTHPasscodeViewController to your project, or add pod 'LTHPasscodeViewController' to your podspec file.

  • When opened from Settings (as a modal):
- (void)showForEnablingPasscodeInViewController:(UIViewController *)viewController;
- (void)showForChangingPasscodeInViewController:(UIViewController *)viewController;
- (void)showForTurningOffPasscodeInViewController:(UIViewController *)viewController;

// Example:
[[LTHPasscodeViewController sharedUser] showForEnablingPasscodeInViewController: self]
  • At app launch, or whenever you'd like the user to be shown a passcode entry:
- (void)showLockscreenWithAnimation:(BOOL)animated;

// Example:
[[LTHPasscodeViewController sharedUser] showLockscreenWithAnimation: YES]
// Displayed with a slide up animation, which, combined with 
// the keyboard sliding down animation, creates an "unlocking" impression.
  • entering foreground and resigning is handled from within the class.

Everything is easily customizable with macros and static constants.

Makes use of SFHFKeyChainUtils to save the passcode in the Keychain. I know he dropped support for it, but I updated it for ARC 2 years ago (with help) and I kept using it since. The 'new' version isn't updated to ARC anyway, so I saw no reason to switch to it, or to any other library.

Rather than writing a big documentation, I heavily commented it as best as I could. Feel free to contact me, or open an issue if anything is unclear, bugged, or can be improved.

Screenshot Screenshot

Apps using this control

Expenses Planner
DigitalOcean Manager
LovelyHeroku

If you're using this control, I'd love hearing from you!

License

Licensed under MIT. If you'd like (or need) a license without attribution, don't hesitate to contact me.

About

iOS 7 style Passcode Lock

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 100.0%