A simple passcode screen that can be displayed manually. If Touch ID is available the user can skip the screen and instead use his fingerprint to unlock.
Can easily be customised to fit your design.
DMPasscode is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "DMPasscode"
If you're not using CocoaPods you'll find the source code files inside Pod/Classes
. You'll also have to add the DMPasscode.bundle
to your project.
To run the example project, clone the repo, and run pod install
from the Example directory first.
The class DMPasscode
contains following methods:
+ (void)setupPasscodeInViewController:(UIViewController *)viewController completion:(PasscodeCompletionBlock)completion;
+ (void)showPasscodeInViewController:(UIViewController *)viewController completion:(PasscodeCompletionBlock)completion;
+ (void)removePasscode;
+ (BOOL)isPasscodeSet;
+ (void)setConfig:(DMPasscodeConfig *)config;
You can pass DMPasscode
a configuration. Just create a new DMPasscodeConfiguration
.
Following properties are available to customise the passcode screen:
animationsEnabled
backgroundColor
navigationBarBackgroundColor
navigationBarForegroundColor
statusBarStyle
fieldColor
emptyFieldColor
errorFont
errorBackgroundColor
errorForegroundColor
descriptionColor
inputKeyboardAppearance
instructionsFont
navigationBarTitle
navigationBarFont
navigationBarTitleColor