All Projects → rolandleth → Lthpasscodeviewcontroller

rolandleth / Lthpasscodeviewcontroller

Licence: mit
iOS 7 style Passcode Lock

Projects that are alternatives of or similar to Lthpasscodeviewcontroller

Zkudid
Generate and save permanent UDID with IDFV and keychain in iOS device.
Stars: ✭ 159 (-74.72%)
Mutual labels:  cocoapods, keychain
Applocker
AppLocker - simple lock screen for iOS Application ( Swift 4+, iOS 9.0+) Touch ID / Face ID
Stars: ✭ 188 (-70.11%)
Mutual labels:  keychain, lockscreen
Ios
Most usable tools for iOS penetration testing
Stars: ✭ 563 (-10.49%)
Mutual labels:  keychain
Orsserialport
Serial port library for Objective-C and Swift macOS apps
Stars: ✭ 609 (-3.18%)
Mutual labels:  cocoapods
Haptica
Easy Haptic Feedback Generator 📳
Stars: ✭ 587 (-6.68%)
Mutual labels:  cocoapods
Swiftinstagram
Instagram API client written in Swift
Stars: ✭ 570 (-9.38%)
Mutual labels:  cocoapods
Ellipticcurvekeypair
Sign, verify, encrypt and decrypt using the Secure Enclave
Stars: ✭ 589 (-6.36%)
Mutual labels:  keychain
Google Maps Ios Utils
Google Maps SDK for iOS Utility Library
Stars: ✭ 558 (-11.29%)
Mutual labels:  cocoapods
Unity Jar Resolver
Unity plugin which resolves Android & iOS dependencies and performs version management
Stars: ✭ 623 (-0.95%)
Mutual labels:  cocoapods
Concentriconboarding
SwiftUI library for a walkthrough or onboarding flow with tap actions
Stars: ✭ 586 (-6.84%)
Mutual labels:  cocoapods
Gradientview
Easily use gradients in UIKit for iOS & tvOS
Stars: ✭ 610 (-3.02%)
Mutual labels:  cocoapods
React Native Starter
Professional react-native starter kit with everything you'll ever need to deploy rock solid apps
Stars: ✭ 579 (-7.95%)
Mutual labels:  cocoapods
Sidemenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.
Stars: ✭ 5,267 (+737.36%)
Mutual labels:  cocoapods
Badgehub
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.
Stars: ✭ 592 (-5.88%)
Mutual labels:  cocoapods
Hysteriaplayer
Objective-C audio player, sitting on top of AVPlayer
Stars: ✭ 568 (-9.7%)
Mutual labels:  cocoapods
Multiprogressview
📊 An animatable view that depicts multiple progresses over time. Modeled after UIProgressView
Stars: ✭ 614 (-2.38%)
Mutual labels:  cocoapods
Pinterestsegment
A Pinterest-like segment control with masking animation.
Stars: ✭ 560 (-10.97%)
Mutual labels:  cocoapods
Gradientloadingbar
⌛️A customizable animated gradient loading bar.
Stars: ✭ 569 (-9.54%)
Mutual labels:  cocoapods
React Native Music Control
Display and manage media controls on lock screen and notification center for iOS and Android.
Stars: ✭ 585 (-7%)
Mutual labels:  lockscreen
Jlroutes
URL routing library for iOS with a simple block-based API
Stars: ✭ 5,528 (+778.86%)
Mutual labels:  cocoapods

LTHPasscodeViewController

Simple to use iOS 7 style Passcode - the one you get in Settings when changing your passcode.

How to use

Drag the contents of LTHPasscodeViewController to your project, or add pod 'LTHPasscodeViewController' to your Podfile (preffered).

If your app uses extensions, LTH_IS_APP_EXTENSION needs to be defined:

  • either in each target's Prefix.pch file, if there is one, via #define LTH_IS_APP_EXTENSION
  • or in each target's build settings, down to Preprocessor Macros, double click each of your schemes, click on the + on the popup that appears and add LTH_IS_APP_EXTENSION

Example, called in application:didFinishLaunchingWithOptions:

[LTHPasscodeViewController useKeychain:NO];
if ([LTHPasscodeViewController doesPasscodeExist]) {
	if ([LTHPasscodeViewController didPasscodeTimerEnd])
		[[LTHPasscodeViewController sharedUser] showLockScreenWithAnimation:YES
                                                                 withLogout:NO
                                                             andLogoutTitle:nil];
}
- (void)passcodeViewControllerWillClose;
- (void)maxNumberOfFailedAttemptsReached;
- (void)passcodeWasEnteredSuccessfully;
- (void)logoutButtonWasPressed;
- (NSTimeInterval)timerDuration;
- (void)saveTimerDuration:(NSTimeInterval)duration;
- (NSTimeInterval)timerStartTime;
- (void)saveTimerStartTime;
- (BOOL)didPasscodeTimerEnd;
- (void)deletePasscode;
- (void)savePasscode:(NSString *)passcode;
- (NSString *)passcode;
// All of them fall back on the Keychain if they are not implemented, even if [LTHPasscodeViewController useKeychain:NO] was called, for flexibility over what and where you save.
// Do you only want to save the passcode in a different location and leave everything else in the Keychain? Call [LTHPasscodeViewController useKeychain:NO], but only implement -savePasscode:
  • Open as a modal, or pushed for changing, enabling or disabling the passcode:
/**
 @param	viewController The view controller where the passcode view controller will be displayed.
 @param asModal        Set to YES to present as a modal, or to NO to push on the current nav stack.
 */
- (void)showForEnablingPasscodeInViewController:(UIViewController *)viewController asModal:(BOOL)isModal;
- (void)showForDisablingPasscodeInViewController:(UIViewController *)viewController asModal:(BOOL)isModal;
- (void)showForChangingPasscodeInViewController:(UIViewController *)viewController asModal:(BOOL)isModal;
  • Show the lock screen over the window:
- (void)showLockScreenWithAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString*)logoutTitle;

// Example:
[[LTHPasscodeViewController sharedUser] showLockscreenWithAnimation:YES withLogout:NO andLogoutTitle:nil];
// Displayed with a slide up animation, which, combined with
// the keyboard sliding down animation, creates an "unlocking" impression.
  • Show the lock screen over a specific view. Works like the above method, but the size and center will be of the passed in view:
- (void)showLockScreenOver:(UIView *)superview withAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString *)logoutTitle;

// Example:
[[LTHPasscodeViewController sharedUser] showLockscreenOver:popover withAnimation:YES withLogout:NO andLogoutTitle:nil];
  • entering foreground and resigning is handled from within the class.

If you're using Storyboards and need to show the lockscreen right at launch, but it's acting weird, you could try and initialise your Storyboard by code, as suggested in this issue by Ben (thank you!).

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.

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, Flow Web Browser, Balance - Checkbook App, QIF Reader, Zee - Personal Finance, EZDiary, MEGA.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].