wantedly/BKPasscodeView

Name: BKPasscodeView

Owner: Wantedly, Inc.

Description: iOS 7 style passcode view. Supports create, change and authenticate password.

Created: 2016-07-08 13:50:15.0

Updated: 2016-07-08 13:50:16.0

Pushed: 2016-07-19 09:24:53.0

Homepage:

Size: 848

Language: Objective-C

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

BKPasscodeView

Screenshots

Screenshot Screenshot Screenshot Screenshot Screenshot Screenshot Screenshot

Classes

| Class | Description | | —– | ———– | | `BKPasscodeField| A custom control that conforms ``UIKeyInput`. When it become first responder keyboard will be displayed to input passcode. | |BKPasscodeInputView`` | A view that supports numeric or normal(ASCII) passcode. This view can display title, message and error message. You can customize label appearances by overriding static methods. | | `BKShiftingPasscodeInputView| A view that make a transition between two ``BKPasscodeInputView`. You can shift passcode views forward and backward. | |BKPasscodeViewController`` | A view controller that supports create, change and authenticate passcode. | | `BKPasscodeLockScreenManager| A manager that shows lock screen when application entered background state. You can activate with ``activateWithDelegate:` method. | |BKTouchIDManager`` | A manager that save, load and delete keychain item. It saves passcode to keychain and item cannot be accessed without fingerprint. |

Podfile
form :ios
'BKPasscodeView', '~> 0.1.2'
Example
Presenting Passcode View Controller
sscodeViewController *viewController = [[BKPasscodeViewController alloc] initWithNibName:nil bundle:nil];
Controller.delegate = self;
Controller.type = BKPasscodeViewControllerNewPasscodeType;
iewController.type = BKPasscodeViewControllerChangePasscodeType;    // for change
iewController.type = BKPasscodeViewControllerCheckPasscodeType;   // for authentication

Controller.passcodeStyle = BKPasscodeInputViewNumericPasscodeStyle;
iewController.passcodeStyle = BKPasscodeInputViewNormalPasscodeStyle;    // for ASCII style passcode.

o supports Touch ID feature, set BKTouchIDManager instance to view controller.
t only supports iOS 8 or greater.
Controller.touchIDManager = [[BKTouchIDManager alloc] initWithKeychainServiceName:@"<# your keychain service name #>"];
Controller.touchIDManager.promptText = @"Scan fingerprint to authenticate";   // You can set prompt text.

vigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
f presentViewController:navController animated:YES completion:nil];
Authenticate with Touch ID without presenting passcode view controller
sscodeViewController *viewController = [[BKPasscodeViewController alloc] initWithNibName:nil bundle:nil];
Controller.delegate = self;
Controller.type = BKPasscodeViewControllerCheckPasscodeType;   // for authentication
Controller.passcodeStyle = BKPasscodeInputViewNumericPasscodeStyle;

o supports Touch ID feature, set BKTouchIDManager instance to view controller.
t only supports iOS 8 or greater.
Controller.touchIDManager = [[BKTouchIDManager alloc] initWithKeychainServiceName:@"<# your keychain service name #>"];
Controller.touchIDManager.promptText = @"Scan fingerprint to authenticate";   // You can set prompt text.

how Touch ID user interface
wController startTouchIDAuthenticationIfPossible:^(BOOL prompted) {

 If Touch ID is unavailable or disabled, present passcode view controller for manual input.
 (NO == prompted) {
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
[self presentViewController:navController animated:YES completion:nil];


Showing Lock Screen
OOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

 ...

BKPasscodeLockScreenManager sharedManager] setDelegate:self];

 ...
turn YES;


oid)applicationDidEnterBackground:(UIApplication *)application

 ...
 show passcode view controller when enter background. Screen will be obscured from here.
BKPasscodeLockScreenManager sharedManager] showLockScreen:NO];


OOL)lockScreenManagerShouldShowLockScreen:(BKPasscodeLockScreenManager *)aManager

turn YES;   // return NO if you don't want to present lock screen.


IViewController *)lockScreenManagerPasscodeViewController:(BKPasscodeLockScreenManager *)aManager

PasscodeViewController *viewController = [[BKPasscodeViewController alloc] initWithNibName:nil bundle:nil];
ewController.type = BKPasscodeViewControllerCheckPasscodeType;
ewController.delegate = <# set delegate to authenticate passcode #>;

NavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
turn navController;


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.