1
1
//
2
- // UIPasscodeViewControllerDemoAppDelegate .m
3
- // UIPasscodeViewControllerDemo
2
+ // PTPasscodeViewControllerDemoAppDelegate .m
3
+ // PTPasscodeViewControllerDemo
4
4
//
5
5
// Created by Lasha Dolidze on 7/7/10.
6
6
// Copyright Picktek LLC 2010. All rights reserved.
7
7
//
8
8
9
- #import " UIPasscodeViewControllerDemoAppDelegate .h"
10
- #import " UIPasscodeViewController .h"
9
+ #import " PTPasscodeViewControllerDemoAppDelegate .h"
10
+ #import " PTPasscodeViewController .h"
11
11
12
12
13
- @implementation UIPasscodeViewControllerDemoAppDelegate
13
+ @implementation PTPasscodeViewControllerDemoAppDelegate
14
14
15
15
@synthesize window = _window;
16
16
@synthesize navigationController = _navigationController;
@@ -29,15 +29,15 @@ - (void)dealloc
29
29
#pragma mark -
30
30
#pragma mark Application lifecycle
31
31
32
- - (void ) applicationDidFinishLaunching : (UIApplication *)application
32
+ - (BOOL ) application : (UIApplication *)application didFinishLaunchingWithOptions : ( NSDictionary *) launchOptions
33
33
{
34
34
35
35
CGRect rect = [[UIScreen mainScreen ] bounds ];
36
36
UIWindow *window = [[UIWindow alloc ] initWithFrame: rect];
37
37
[self setWindow: window];
38
38
39
39
40
- UIPasscodeViewController *passcodeViewController = [[UIPasscodeViewController alloc ] initWithDelegate: self ];
40
+ PTPasscodeViewController *passcodeViewController = [[PTPasscodeViewController alloc ] initWithDelegate: self ];
41
41
42
42
UINavigationController *navController = [[UINavigationController alloc ]
43
43
initWithRootViewController: passcodeViewController];
@@ -49,6 +49,8 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application
49
49
50
50
[window release ];
51
51
[navController release ];
52
+
53
+ return TRUE ;
52
54
}
53
55
54
56
@@ -57,32 +59,32 @@ - (void)applicationWillTerminate:(UIApplication *)application {
57
59
}
58
60
59
61
60
- - (void ) didShowPasscodePanel : (UIPasscodeViewController *)passcodeView panelView : (UIView*)panelView
62
+ - (void ) didShowPasscodePanel : (PTPasscodeViewController *)passcodeViewController panelView : (UIView*)panelView
61
63
{
62
- [passcodeView setTitle: @" Set Passcode" ];
64
+ [passcodeViewController setTitle: @" Set Passcode" ];
63
65
64
66
if ([panelView tag ] == kPasscodePanelOne ) {
65
- [[passcodeView titleLabel ] setText: @" Enter a passcode" ];
67
+ [[passcodeViewController titleLabel ] setText: @" Enter a passcode" ];
66
68
}
67
69
68
70
if ([panelView tag ] == kPasscodePanelTwo ) {
69
- [[passcodeView titleLabel ] setText: @" Re-enter your passcode" ];
71
+ [[passcodeViewController titleLabel ] setText: @" Re-enter your passcode" ];
70
72
}
71
73
72
74
if ([panelView tag ] == kPasscodePanelThree ) {
73
- [[passcodeView titleLabel ] setText: @" Panel 3" ];
75
+ [[passcodeViewController titleLabel ] setText: @" Panel 3" ];
74
76
}
75
77
}
76
78
77
- - (BOOL )shouldChangePasscode : (UIPasscodeViewController *)passcodeView panelView : (UIView*)panelView passCode : (NSUInteger )passCode lastNumber : (NSInteger )lastNumber ;
79
+ - (BOOL )shouldChangePasscode : (PTPasscodeViewController *)passcodeViewController panelView : (UIView*)panelView passCode : (NSUInteger )passCode lastNumber : (NSInteger )lastNumber ;
78
80
{
79
81
// Clear summary text
80
- [[passcodeView summaryLabel ] setText: @" " ];
82
+ [[passcodeViewController summaryLabel ] setText: @" " ];
81
83
82
84
return TRUE ;
83
85
}
84
86
85
- - (BOOL )didEndPasscodeEditing : (UIPasscodeViewController *)passcodeView panelView : (UIView*)panelView passCode : (NSUInteger )passCode
87
+ - (BOOL )didEndPasscodeEditing : (PTPasscodeViewController *)passcodeViewController panelView : (UIView*)panelView passCode : (NSUInteger )passCode
86
88
{
87
89
88
90
NSLog (@" END PASSCODE - %d " , passCode);
@@ -98,18 +100,18 @@ - (BOOL)didEndPasscodeEditing:(UIPasscodeViewController *)passcodeView panelView
98
100
return FALSE;
99
101
}
100
102
*/
101
- return ![passcodeView nextPanel ];
103
+ return ![passcodeViewController nextPanel ];
102
104
}
103
105
104
106
if ([panelView tag ] == kPasscodePanelTwo ) {
105
107
_retryPassCode = passCode;
106
108
107
109
if (_retryPassCode != _passCode) {
108
- [passcodeView prevPanel ];
109
- [[passcodeView summaryLabel ] setText: @" Passcode did not match. Try again." ];
110
+ [passcodeViewController prevPanel ];
111
+ [[passcodeViewController summaryLabel ] setText: @" Passcode did not match. Try again." ];
110
112
return FALSE ;
111
113
} else {
112
- [[passcodeView summaryLabel ] setText: @" Good boy !" ];
114
+ [[passcodeViewController summaryLabel ] setText: @" Good boy !" ];
113
115
}
114
116
115
117
}
0 commit comments