-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathDMPasscode.h
More file actions
67 lines (56 loc) · 1.88 KB
/
DMPasscode.h
File metadata and controls
67 lines (56 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//
// DMPasscode.h
// DMPasscode
//
// Created by Dylan Marriott on 20/09/14.
// Copyright (c) 2014 Dylan Marriott. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "DMPasscodeConfig.h"
typedef void (^PasscodeCompletionBlock)(BOOL success);
/**
* The passcode screen has to be manually opened. You decide when it should be presented.
* The chosen code is stored inside the keychain.
* First let the user set a passcode by calling the setupPasscodeInViewController:completion: method.
* If you want to authenticate the user, simple call showPasscodeInViewController:completion.
*/
@interface DMPasscode : NSObject
/**
* Setup a new passcode.
*
* @param viewController The view controller in which the passcode screen will be presented
* @param completion The completion block with a BOOL to inidcate if the setup was successfull
*/
+ (void)setupPasscodeInViewController:(UIViewController *)viewController completion:(PasscodeCompletionBlock)completion;
/**
* Authenticate the user.
*
* @param viewController The view controller in which the passcode screen will be presented
* @param completion The completion block with a BOOL to inidcate if the authentication was successfull
*/
+ (void)showPasscodeInViewController:(UIViewController *)viewController completion:(PasscodeCompletionBlock)completion;
+ (void)lockScreenWithCompletion:(PasscodeCompletionBlock)completion;
/**
* Remove the passcode from the keychain.
*/
+ (void)removePasscode;
/**
* Check if a passcode is already set.
*
* @return BOOL indicating if a passcode is set
*/
+ (BOOL)isPasscodeSet;
/**
* Set a configuration.
*
* @param config configuration which should be uses.
*/
+ (void)setConfig:(DMPasscodeConfig *)config;
/**
* Check if a input is already set.
*
* @return BOOL indicating if a passcode is set
*/
+ (BOOL)isShowingPasscode;
@end