Skip to content
🔒 Passcode screen with Touch ID support
Objective-C Shell C Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
DMPasscode.bundle/en.lproj Added bundle with strings for non-cocoapods users Sep 23, 2014
Example New version 2.0.1 Apr 14, 2015
Pod Allows for the user to tap on the fields of the passcode to bring the… Apr 14, 2015
.gitignore First working version Sep 21, 2014
.travis.yml
DMPasscode.podspec New version 2.0.1 Apr 14, 2015
LICENSE First working version Sep 21, 2014
README.md

README.md

DMPasscode

Build Status Version License twitter: @dylan36032

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.

image

Installation

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.

Usage

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;

PasscodeCompletionBlock(BOOL success, NSError *error)

PasscodeCompletionBlock is a custom type of block provided to DMPasscode that returns values in the form of two parameters, a BOOL success and a NSError *error. If success, then the user has successfully either setup their passcode, or successfully unlocked with their passcode.

If not success, then the user has either cancelled the passcode process, in which case error will be nil. Or the user has failed to unlock with their passcode, in which case error will not be nil.

Customisation

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
You can’t perform that action at this time.