9
9
#import < UIKit/UIKit.h>
10
10
#import " TOPasscodeViewControllerConstants.h"
11
11
12
+ @class TOPasscodeSettingsViewController;
13
+
12
14
typedef NS_ENUM (NSInteger , TOPasscodeSettingsViewState) {
13
15
TOPasscodeSettingsViewStateEnterNewPassword,
14
16
TOPasscodeSettingsViewStateConfirmNewPassword,
@@ -17,14 +19,33 @@ typedef NS_ENUM(NSInteger, TOPasscodeSettingsViewState) {
17
19
18
20
NS_ASSUME_NONNULL_BEGIN
19
21
22
+ @protocol TOPasscodeSettingsViewControllerDelegate <NSObject >
23
+
24
+ /* * Called when the user was prompted to input their current passcode.
25
+ Return YES if passcode was right and NO otherwise.
26
+
27
+ Returning NO will cause a warning label to appear
28
+ */
29
+ - (BOOL )passcodeSettingsViewControllerDidAttemptCurrentPasscode : (NSString *)passcode ;
30
+
31
+ /* * Called when the user has successfully set a new passcode. At this point, you should save over
32
+ the old passcode with the new one. */
33
+ - (void )passcodeSettingsViewControllerDidChangeToNewPasscode : (NSString *)passcode ofType : (TOPasscodeType)type ;
34
+
35
+ @end
36
+
37
+ // ----------------------------------------------------------------------
38
+
20
39
@interface TOPasscodeSettingsViewController : UIViewController
21
40
22
- /* Set the visual style of the view controller (light or dark) */
41
+ /* * Set the visual style of the view controller (light or dark) */
23
42
@property (nonatomic , assign ) TOPasscodeSettingsViewStyle style;
24
43
25
- /* Before setting a new passcode, show a UI to validate the existing password. (Default is YES) */
44
+ /* * Before setting a new passcode, show a UI to validate the existing password. (Default is YES) */
26
45
@property (nonatomic , assign ) BOOL requireCurrentPasscode;
27
46
47
+ /* * If set, the view controller will disable input until this date time has been reached */
48
+
28
49
/* Create a new instance with the desird light or dark style */
29
50
- (instancetype )initWithStyle : (TOPasscodeSettingsViewStyle)style ;
30
51
0 commit comments