├── PasscodeSample ├── PasscodeSample │ ├── en.lproj │ │ ├── InfoPlist.strings │ │ ├── MainWindow.xib │ │ └── RootViewController.xib │ ├── PasscodeSample-Prefix.pch │ ├── main.m │ ├── RootViewController.h │ ├── PasscodeSampleAppDelegate.h │ ├── PasscodeSample-Info.plist │ ├── RootViewController.m │ └── PasscodeSampleAppDelegate.m └── PasscodeSample.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ └── project.pbxproj ├── README.mdown ├── KVPasscodeViewController.h ├── KVPasscodeViewController.m └── KVPasscodeViewController.xib /PasscodeSample/PasscodeSample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /PasscodeSample/PasscodeSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PasscodeSample/PasscodeSample/PasscodeSample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'PasscodeSample' target in the 'PasscodeSample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /PasscodeSample/PasscodeSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PasscodeSample 4 | // 5 | // Created by Johan Kool on 3/17/11. 6 | // Copyright 2011 Koolistov. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /PasscodeSample/PasscodeSample/RootViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.h 3 | // PasscodeSample 4 | // 5 | // Created by Johan Kool on 3/17/11. 6 | // Copyright 2011 Koolistov. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "KVPasscodeViewController.h" 12 | 13 | @interface RootViewController : UIViewController { 14 | 15 | } 16 | 17 | - (IBAction)showPasscode:(id)sender; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /PasscodeSample/PasscodeSample/PasscodeSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // PasscodeSampleAppDelegate.h 3 | // PasscodeSample 4 | // 5 | // Created by Johan Kool on 3/17/11. 6 | // Copyright 2011 Koolistov. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PasscodeSampleAppDelegate : NSObject { 12 | 13 | } 14 | 15 | @property (nonatomic, retain) IBOutlet UIWindow *window; 16 | 17 | @property (nonatomic, retain) IBOutlet UINavigationController *navigationController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /PasscodeSample/PasscodeSample/PasscodeSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.koolistov.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /PasscodeSample/PasscodeSample/RootViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.m 3 | // PasscodeSample 4 | // 5 | // Created by Johan Kool on 3/17/11. 6 | // Copyright 2011 Koolistov. All rights reserved. 7 | // 8 | 9 | #import "RootViewController.h" 10 | 11 | @implementation RootViewController 12 | 13 | - (IBAction)showPasscode:(id)sender { 14 | KVPasscodeViewController *passcodeController = [[KVPasscodeViewController alloc] init]; 15 | passcodeController.delegate = self; 16 | UINavigationController *passcodeNavigationController = [[UINavigationController alloc] initWithRootViewController:passcodeController]; 17 | [self.navigationController presentModalViewController:passcodeNavigationController animated:YES]; 18 | [passcodeNavigationController release]; 19 | [passcodeController release]; 20 | } 21 | 22 | #pragma mark - KVPasscodeViewControllerDelegate 23 | - (void)passcodeController:(KVPasscodeViewController *)controller passcodeEntered:(NSString *)passCode { 24 | if ([passCode isEqualToString:@"1234"]) { 25 | [controller dismissModalViewControllerAnimated:YES]; 26 | } else if ([passCode isEqualToString:@"0000"]) { 27 | controller.instructionLabel.text = NSLocalizedString(@"Please confirm passcode.", @""); 28 | [controller resetWithAnimation:KVPasscodeAnimationStyleConfirm]; 29 | } else { 30 | controller.instructionLabel.text = [NSString stringWithFormat:NSLocalizedString(@"You entered: '%@'. Try '1234' or '0000'.", @""), passCode]; 31 | [controller resetWithAnimation:KVPasscodeAnimationStyleInvalid]; 32 | } 33 | } 34 | 35 | #pragma mark - 36 | - (void)didReceiveMemoryWarning 37 | { 38 | // Releases the view if it doesn't have a superview. 39 | [super didReceiveMemoryWarning]; 40 | 41 | // Relinquish ownership any cached data, images, etc that aren't in use. 42 | } 43 | 44 | - (void)viewDidUnload 45 | { 46 | [super viewDidUnload]; 47 | 48 | // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand. 49 | // For example: self.myOutlet = nil; 50 | } 51 | 52 | - (void)dealloc 53 | { 54 | [super dealloc]; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /README.mdown: -------------------------------------------------------------------------------- 1 | PASSCODE VIEW CONTROLLER 2 | ======================== 3 | 4 | A view controller that lets you enter 4 digit pass codes. It supports animations for invalid entries and to confirm entries. 5 | 6 | USAGE 7 | ----- 8 | Your app needs to link against the QuartzCore framework and the AudioToolbox framework. 9 | 10 | SAMPLE 11 | ------ 12 | A straightforward sample application is included. 13 | 14 | LICENSE 15 | ------- 16 | Copyright 2011 Koolistov. All rights reserved. 17 | 18 | Redistribution and use in source and binary forms, with or without modification, are 19 | permitted provided that the following conditions are met: 20 | 21 | * Redistributions of source code must retain the above copyright notice, this list of 22 | conditions and the following disclaimer. 23 | * Redistributions in binary form must reproduce the above copyright notice, this list 24 | of conditions and the following disclaimer in the documentation and/or other materials 25 | provided with the distribution. 26 | * Neither the name of KOOLISTOV nor the names of its contributors may be used to 27 | endorse or promote products derived from this software without specific prior written 28 | permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 31 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 32 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 33 | THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 35 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 37 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | AUTHOR 41 | ------ 42 | Johan Kool is an developer of iOS and Mac OS X (Cocoa and Cocoa touch) software. If you wish to hire me, please look at [www.koolistov.net/services](http://www.koolistov.net/services/). 43 | 44 | -- Thanks! 45 | 46 | Johan 47 | -------------------------------------------------------------------------------- /PasscodeSample/PasscodeSample/PasscodeSampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // PasscodeSampleAppDelegate.m 3 | // PasscodeSample 4 | // 5 | // Created by Johan Kool on 3/17/11. 6 | // Copyright 2011 Koolistov. All rights reserved. 7 | // 8 | 9 | #import "PasscodeSampleAppDelegate.h" 10 | 11 | @implementation PasscodeSampleAppDelegate 12 | 13 | 14 | @synthesize window=_window; 15 | 16 | @synthesize navigationController=_navigationController; 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 19 | { 20 | // Override point for customization after application launch. 21 | // Add the navigation controller's view to the window and display. 22 | self.window.rootViewController = self.navigationController; 23 | [self.window makeKeyAndVisible]; 24 | 25 | return YES; 26 | } 27 | 28 | 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | /* 33 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 34 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 35 | */ 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | /* 41 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 42 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 43 | */ 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application 47 | { 48 | /* 49 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 50 | */ 51 | } 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application 54 | { 55 | /* 56 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 57 | */ 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | /* 63 | Called when the application is about to terminate. 64 | Save data if appropriate. 65 | See also applicationDidEnterBackground:. 66 | */ 67 | } 68 | 69 | - (void)dealloc 70 | { 71 | [_window release]; 72 | [_navigationController release]; 73 | [super dealloc]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /KVPasscodeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // KVPasscodeViewController.h 3 | // Koolistov 4 | // 5 | // Created by Johan Kool on 3/17/11. 6 | // Copyright 2011 Koolistov. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above copyright notice, this list 14 | // of conditions and the following disclaimer in the documentation and/or other materials 15 | // provided with the distribution. 16 | // * Neither the name of KOOLISTOV nor the names of its contributors may be used to 17 | // endorse or promote products derived from this software without specific prior written 18 | // permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 21 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 23 | // THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | 31 | #import 32 | 33 | @class KVPasscodeViewController; 34 | 35 | @protocol KVPasscodeViewControllerDelegate 36 | 37 | - (void)passcodeController:(KVPasscodeViewController *)controller passcodeEntered:(NSString *)passCode; 38 | 39 | @end 40 | 41 | typedef enum { 42 | KVPasscodeAnimationStyleNone, 43 | KVPasscodeAnimationStyleInvalid, 44 | KVPasscodeAnimationStyleConfirm 45 | } KVPasscodeAnimationStyle; 46 | 47 | @interface KVPasscodeViewController : UIViewController { 48 | id delegate; 49 | 50 | IBOutlet UIView *animationView; 51 | 52 | IBOutlet UILabel *titleLabel; 53 | IBOutlet UILabel *instructionLabel; 54 | 55 | IBOutlet UITextField *bulletField0; 56 | IBOutlet UITextField *bulletField1; 57 | IBOutlet UITextField *bulletField2; 58 | IBOutlet UITextField *bulletField3; 59 | 60 | UITextField *fakeField; 61 | } 62 | 63 | @property (nonatomic, assign) id delegate; 64 | 65 | @property (nonatomic, retain) IBOutlet UIView *animationView; 66 | 67 | @property (nonatomic, retain) IBOutlet UILabel *titleLabel; 68 | @property (nonatomic, retain) IBOutlet UILabel *instructionLabel; 69 | 70 | @property (nonatomic, retain) IBOutlet UITextField *bulletField0; 71 | @property (nonatomic, retain) IBOutlet UITextField *bulletField1; 72 | @property (nonatomic, retain) IBOutlet UITextField *bulletField2; 73 | @property (nonatomic, retain) IBOutlet UITextField *bulletField3; 74 | 75 | - (void)resetWithAnimation:(KVPasscodeAnimationStyle)animationStyle; 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /KVPasscodeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // KVPasscodeViewController.m 3 | // Koolistov 4 | // 5 | // Created by Johan Kool on 3/17/11. 6 | // Copyright 2011 Koolistov. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // * Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // * Redistributions in binary form must reproduce the above copyright notice, this list 14 | // of conditions and the following disclaimer in the documentation and/or other materials 15 | // provided with the distribution. 16 | // * Neither the name of KOOLISTOV nor the names of its contributors may be used to 17 | // endorse or promote products derived from this software without specific prior written 18 | // permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 21 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 23 | // THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | 31 | #import "KVPasscodeViewController.h" 32 | 33 | #import 34 | #import 35 | 36 | @interface KVPasscodeViewController () 37 | 38 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag; 39 | - (void)internalResetWithAnimation:(NSNumber *)animationStyleNumber; 40 | - (void)notifyDelegate:(NSString *)passcode; 41 | 42 | @end 43 | 44 | @implementation KVPasscodeViewController 45 | 46 | @synthesize delegate; 47 | 48 | @synthesize animationView; 49 | 50 | @synthesize titleLabel; 51 | @synthesize instructionLabel; 52 | 53 | @synthesize bulletField0; 54 | @synthesize bulletField1; 55 | @synthesize bulletField2; 56 | @synthesize bulletField3; 57 | 58 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 59 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 60 | if (self) { 61 | // Custom initialization 62 | } 63 | return self; 64 | } 65 | 66 | - (void)dealloc { 67 | [animationView release], animationView = nil; 68 | 69 | [titleLabel release], titleLabel = nil; 70 | [instructionLabel release], instructionLabel = nil; 71 | 72 | [bulletField0 release], bulletField0 = nil; 73 | [bulletField1 release], bulletField1 = nil; 74 | [bulletField2 release], bulletField2 = nil; 75 | [bulletField3 release], bulletField3 = nil; 76 | [super dealloc]; 77 | } 78 | 79 | - (void)didReceiveMemoryWarning { 80 | // Releases the view if it doesn't have a superview. 81 | [super didReceiveMemoryWarning]; 82 | 83 | // Release any cached data, images, etc that aren't in use. 84 | } 85 | 86 | #pragma mark - View lifecycle 87 | 88 | - (void)viewDidLoad { 89 | [super viewDidLoad]; 90 | 91 | fakeField = [[UITextField alloc] initWithFrame:CGRectZero]; 92 | fakeField.delegate = self; 93 | fakeField.keyboardType = UIKeyboardTypeNumberPad; 94 | fakeField.secureTextEntry = YES; 95 | fakeField.text = @""; 96 | [fakeField becomeFirstResponder]; 97 | [self.view addSubview:fakeField]; 98 | [fakeField release]; 99 | 100 | // Do any additional setup after loading the view from its nib. 101 | self.navigationItem.title = NSLocalizedString(@"Passcode", @""); 102 | } 103 | 104 | - (void)viewDidUnload { 105 | [super viewDidUnload]; 106 | // Release any retained subviews of the main view. 107 | // e.g. self.myOutlet = nil; 108 | fakeField = nil; 109 | 110 | self.animationView = nil; 111 | 112 | self.titleLabel = nil; 113 | self.instructionLabel = nil; 114 | 115 | self.bulletField0 = nil; 116 | self.bulletField1 = nil; 117 | self.bulletField2 = nil; 118 | self.bulletField3 = nil; 119 | } 120 | 121 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 122 | // Return YES for supported orientations 123 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 124 | } 125 | 126 | - (void)internalResetWithAnimation:(NSNumber *)animationStyleNumber { 127 | KVPasscodeAnimationStyle animationStyle = [animationStyleNumber intValue]; 128 | switch (animationStyle) { 129 | case KVPasscodeAnimationStyleInvalid: 130 | ; 131 | 132 | // Vibrate to indicate error 133 | AudioServicesPlayAlertSound(kSystemSoundID_Vibrate); 134 | 135 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"]; 136 | [animation setDelegate:self]; 137 | [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:)]; 138 | [animation setDuration:0.025]; 139 | [animation setRepeatCount:8]; 140 | [animation setAutoreverses:YES]; 141 | [animation setFromValue:[NSValue valueWithCGPoint: 142 | CGPointMake([animationView center].x - 14.0f, [animationView center].y)]]; 143 | [animation setToValue:[NSValue valueWithCGPoint: 144 | CGPointMake([animationView center].x + 14.0f, [animationView center].y)]]; 145 | [[animationView layer] addAnimation:animation forKey:@"position"]; 146 | break; 147 | case KVPasscodeAnimationStyleConfirm: 148 | ; 149 | 150 | // This will cause the 'new' fields to appear without bullets already in them 151 | self.bulletField0.text = nil; 152 | self.bulletField1.text = nil; 153 | self.bulletField2.text = nil; 154 | self.bulletField3.text = nil; 155 | 156 | CATransition *transition = [CATransition animation]; 157 | [transition setDelegate:self]; 158 | [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:)]; 159 | [transition setType:kCATransitionPush]; 160 | [transition setSubtype:kCATransitionFromRight]; 161 | [transition setDuration:0.5f]; 162 | [transition setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 163 | [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1]; 164 | [[animationView layer] addAnimation:transition forKey:@"swipe"]; 165 | break; 166 | case KVPasscodeAnimationStyleNone: 167 | default: 168 | self.bulletField0.text = nil; 169 | self.bulletField1.text = nil; 170 | self.bulletField2.text = nil; 171 | self.bulletField3.text = nil; 172 | 173 | fakeField.text = @""; 174 | break; 175 | } 176 | } 177 | 178 | - (void)resetWithAnimation:(KVPasscodeAnimationStyle)animationStyle { 179 | // Do the animation a little later (for better animation) as it's likely this method is called in our delegate method 180 | [self performSelector:@selector(internalResetWithAnimation:) withObject:[NSNumber numberWithInt:animationStyle] afterDelay:0]; 181 | } 182 | 183 | - (void)notifyDelegate:(NSString *)passcode { 184 | [self.delegate passcodeController:self passcodeEntered:passcode]; 185 | fakeField.text = @""; 186 | } 187 | 188 | #pragma mark - CAAnimationDelegate 189 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { 190 | self.bulletField0.text = nil; 191 | self.bulletField1.text = nil; 192 | self.bulletField2.text = nil; 193 | self.bulletField3.text = nil; 194 | 195 | fakeField.text = @""; 196 | } 197 | 198 | #pragma mark - UITextFieldDelegate 199 | - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { 200 | NSString *passcode = [textField text]; 201 | passcode = [passcode stringByReplacingCharactersInRange:range withString:string]; 202 | 203 | switch ([passcode length]) { 204 | case 0: 205 | self.bulletField0.text = nil; 206 | self.bulletField1.text = nil; 207 | self.bulletField2.text = nil; 208 | self.bulletField3.text = nil; 209 | break; 210 | case 1: 211 | self.bulletField0.text = @"*"; 212 | self.bulletField1.text = nil; 213 | self.bulletField2.text = nil; 214 | self.bulletField3.text = nil; 215 | break; 216 | case 2: 217 | self.bulletField0.text = @"*"; 218 | self.bulletField1.text = @"*"; 219 | self.bulletField2.text = nil; 220 | self.bulletField3.text = nil; 221 | break; 222 | case 3: 223 | self.bulletField0.text = @"*"; 224 | self.bulletField1.text = @"*"; 225 | self.bulletField2.text = @"*"; 226 | self.bulletField3.text = nil; 227 | break; 228 | case 4: 229 | self.bulletField0.text = @"*"; 230 | self.bulletField1.text = @"*"; 231 | self.bulletField2.text = @"*"; 232 | self.bulletField3.text = @"*"; 233 | 234 | // Notify delegate a little later so we have a chance to show the 4th bullet 235 | [self performSelector:@selector(notifyDelegate:) withObject:passcode afterDelay:0]; 236 | 237 | return NO; 238 | 239 | break; 240 | default: 241 | break; 242 | } 243 | 244 | return YES; 245 | } 246 | 247 | @end 248 | -------------------------------------------------------------------------------- /PasscodeSample/PasscodeSample/en.lproj/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10J567 6 | 1305 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 300 12 | 13 | 14 | YES 15 | IBProxyObject 16 | IBUINavigationController 17 | IBUIViewController 18 | IBUICustomObject 19 | IBUIWindow 20 | IBUINavigationBar 21 | IBUINavigationItem 22 | 23 | 24 | YES 25 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 26 | 27 | 28 | YES 29 | 30 | YES 31 | 32 | 33 | 34 | 35 | YES 36 | 37 | IBFilesOwner 38 | IBCocoaTouchFramework 39 | 40 | 41 | IBFirstResponder 42 | IBCocoaTouchFramework 43 | 44 | 45 | IBCocoaTouchFramework 46 | 47 | 48 | 49 | 1316 50 | 51 | {320, 480} 52 | 53 | 54 | 55 | 1 56 | MSAxIDEAA 57 | 58 | NO 59 | NO 60 | 61 | IBCocoaTouchFramework 62 | YES 63 | 64 | 65 | 66 | 67 | 1 68 | 1 69 | 70 | IBCocoaTouchFramework 71 | NO 72 | 73 | 74 | 256 75 | {0, 0} 76 | NO 77 | YES 78 | YES 79 | IBCocoaTouchFramework 80 | 81 | 82 | YES 83 | 84 | 85 | 86 | IBCocoaTouchFramework 87 | 88 | 89 | RootViewController 90 | 91 | 92 | 1 93 | 1 94 | 95 | IBCocoaTouchFramework 96 | NO 97 | 98 | 99 | YES 100 | 101 | 102 | 103 | 104 | YES 105 | 106 | 107 | delegate 108 | 109 | 110 | 111 | 4 112 | 113 | 114 | 115 | window 116 | 117 | 118 | 119 | 5 120 | 121 | 122 | 123 | navigationController 124 | 125 | 126 | 127 | 15 128 | 129 | 130 | 131 | 132 | YES 133 | 134 | 0 135 | 136 | 137 | 138 | 139 | 140 | 2 141 | 142 | 143 | YES 144 | 145 | 146 | 147 | 148 | -1 149 | 150 | 151 | File's Owner 152 | 153 | 154 | 3 155 | 156 | 157 | 158 | 159 | -2 160 | 161 | 162 | 163 | 164 | 9 165 | 166 | 167 | YES 168 | 169 | 170 | 171 | 172 | 173 | 174 | 11 175 | 176 | 177 | 178 | 179 | 13 180 | 181 | 182 | YES 183 | 184 | 185 | 186 | 187 | 188 | 14 189 | 190 | 191 | 192 | 193 | 194 | 195 | YES 196 | 197 | YES 198 | -1.CustomClassName 199 | -2.CustomClassName 200 | 11.IBPluginDependency 201 | 13.CustomClassName 202 | 13.IBPluginDependency 203 | 2.IBAttributePlaceholdersKey 204 | 2.IBEditorWindowLastContentRect 205 | 2.IBPluginDependency 206 | 3.CustomClassName 207 | 3.IBPluginDependency 208 | 9.IBEditorWindowLastContentRect 209 | 9.IBPluginDependency 210 | 211 | 212 | YES 213 | UIApplication 214 | UIResponder 215 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 216 | RootViewController 217 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 218 | 219 | YES 220 | 221 | 222 | 223 | {{673, 376}, {320, 480}} 224 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 225 | PasscodeSampleAppDelegate 226 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 227 | {{186, 376}, {320, 480}} 228 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 229 | 230 | 231 | 232 | YES 233 | 234 | 235 | 236 | 237 | 238 | YES 239 | 240 | 241 | 242 | 243 | 16 244 | 245 | 246 | 247 | YES 248 | 249 | PasscodeSampleAppDelegate 250 | NSObject 251 | 252 | YES 253 | 254 | YES 255 | navigationController 256 | window 257 | 258 | 259 | YES 260 | UINavigationController 261 | UIWindow 262 | 263 | 264 | 265 | YES 266 | 267 | YES 268 | navigationController 269 | window 270 | 271 | 272 | YES 273 | 274 | navigationController 275 | UINavigationController 276 | 277 | 278 | window 279 | UIWindow 280 | 281 | 282 | 283 | 284 | IBProjectSource 285 | ./Classes/PasscodeSampleAppDelegate.h 286 | 287 | 288 | 289 | RootViewController 290 | UIViewController 291 | 292 | showPasscode: 293 | id 294 | 295 | 296 | showPasscode: 297 | 298 | showPasscode: 299 | id 300 | 301 | 302 | 303 | IBProjectSource 304 | ./Classes/RootViewController.h 305 | 306 | 307 | 308 | 309 | 0 310 | IBCocoaTouchFramework 311 | 312 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 313 | 314 | 315 | 316 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 317 | 318 | 319 | YES 320 | 3 321 | 300 322 | 323 | 324 | -------------------------------------------------------------------------------- /PasscodeSample/PasscodeSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C79F70EA13325C64007B9A22 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C79F70E913325C64007B9A22 /* UIKit.framework */; }; 11 | C79F70EC13325C64007B9A22 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C79F70EB13325C64007B9A22 /* Foundation.framework */; }; 12 | C79F70EE13325C64007B9A22 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C79F70ED13325C64007B9A22 /* CoreGraphics.framework */; }; 13 | C79F70F413325C64007B9A22 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C79F70F213325C64007B9A22 /* InfoPlist.strings */; }; 14 | C79F70F713325C64007B9A22 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C79F70F613325C64007B9A22 /* main.m */; }; 15 | C79F70FA13325C64007B9A22 /* PasscodeSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C79F70F913325C64007B9A22 /* PasscodeSampleAppDelegate.m */; }; 16 | C79F70FD13325C64007B9A22 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = C79F70FB13325C64007B9A22 /* MainWindow.xib */; }; 17 | C79F710013325C64007B9A22 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C79F70FF13325C64007B9A22 /* RootViewController.m */; }; 18 | C79F710313325C64007B9A22 /* RootViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C79F710113325C64007B9A22 /* RootViewController.xib */; }; 19 | C79F710C13325C73007B9A22 /* KVPasscodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C79F710A13325C73007B9A22 /* KVPasscodeViewController.m */; }; 20 | C79F710D13325C73007B9A22 /* KVPasscodeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C79F710B13325C73007B9A22 /* KVPasscodeViewController.xib */; }; 21 | C79F710F1332670E007B9A22 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C79F710E1332670E007B9A22 /* QuartzCore.framework */; }; 22 | C79F711213338C8F007B9A22 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C79F711113338C8F007B9A22 /* AudioToolbox.framework */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | C79F70E513325C64007B9A22 /* PasscodeSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PasscodeSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 27 | C79F70E913325C64007B9A22 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 28 | C79F70EB13325C64007B9A22 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 29 | C79F70ED13325C64007B9A22 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 30 | C79F70F113325C64007B9A22 /* PasscodeSample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PasscodeSample-Info.plist"; sourceTree = ""; }; 31 | C79F70F313325C64007B9A22 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 32 | C79F70F513325C64007B9A22 /* PasscodeSample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PasscodeSample-Prefix.pch"; sourceTree = ""; }; 33 | C79F70F613325C64007B9A22 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 34 | C79F70F813325C64007B9A22 /* PasscodeSampleAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PasscodeSampleAppDelegate.h; sourceTree = ""; }; 35 | C79F70F913325C64007B9A22 /* PasscodeSampleAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PasscodeSampleAppDelegate.m; sourceTree = ""; }; 36 | C79F70FC13325C64007B9A22 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = ""; }; 37 | C79F70FE13325C64007B9A22 /* RootViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; 38 | C79F70FF13325C64007B9A22 /* RootViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; }; 39 | C79F710213325C64007B9A22 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/RootViewController.xib; sourceTree = ""; }; 40 | C79F710913325C73007B9A22 /* KVPasscodeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KVPasscodeViewController.h; path = ../KVPasscodeViewController.h; sourceTree = ""; }; 41 | C79F710A13325C73007B9A22 /* KVPasscodeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KVPasscodeViewController.m; path = ../KVPasscodeViewController.m; sourceTree = ""; }; 42 | C79F710B13325C73007B9A22 /* KVPasscodeViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = KVPasscodeViewController.xib; path = ../KVPasscodeViewController.xib; sourceTree = ""; }; 43 | C79F710E1332670E007B9A22 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 44 | C79F711113338C8F007B9A22 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | C79F70E213325C64007B9A22 /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | C79F711213338C8F007B9A22 /* AudioToolbox.framework in Frameworks */, 53 | C79F710F1332670E007B9A22 /* QuartzCore.framework in Frameworks */, 54 | C79F70EA13325C64007B9A22 /* UIKit.framework in Frameworks */, 55 | C79F70EC13325C64007B9A22 /* Foundation.framework in Frameworks */, 56 | C79F70EE13325C64007B9A22 /* CoreGraphics.framework in Frameworks */, 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXFrameworksBuildPhase section */ 61 | 62 | /* Begin PBXGroup section */ 63 | C79F70DA13325C64007B9A22 = { 64 | isa = PBXGroup; 65 | children = ( 66 | C79F710913325C73007B9A22 /* KVPasscodeViewController.h */, 67 | C79F710A13325C73007B9A22 /* KVPasscodeViewController.m */, 68 | C79F710B13325C73007B9A22 /* KVPasscodeViewController.xib */, 69 | C79F70EF13325C64007B9A22 /* PasscodeSample */, 70 | C79F70E813325C64007B9A22 /* Frameworks */, 71 | C79F70E613325C64007B9A22 /* Products */, 72 | ); 73 | sourceTree = ""; 74 | }; 75 | C79F70E613325C64007B9A22 /* Products */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | C79F70E513325C64007B9A22 /* PasscodeSample.app */, 79 | ); 80 | name = Products; 81 | sourceTree = ""; 82 | }; 83 | C79F70E813325C64007B9A22 /* Frameworks */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | C79F711113338C8F007B9A22 /* AudioToolbox.framework */, 87 | C79F710E1332670E007B9A22 /* QuartzCore.framework */, 88 | C79F70E913325C64007B9A22 /* UIKit.framework */, 89 | C79F70EB13325C64007B9A22 /* Foundation.framework */, 90 | C79F70ED13325C64007B9A22 /* CoreGraphics.framework */, 91 | ); 92 | name = Frameworks; 93 | sourceTree = ""; 94 | }; 95 | C79F70EF13325C64007B9A22 /* PasscodeSample */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | C79F70F813325C64007B9A22 /* PasscodeSampleAppDelegate.h */, 99 | C79F70F913325C64007B9A22 /* PasscodeSampleAppDelegate.m */, 100 | C79F70FB13325C64007B9A22 /* MainWindow.xib */, 101 | C79F70FE13325C64007B9A22 /* RootViewController.h */, 102 | C79F70FF13325C64007B9A22 /* RootViewController.m */, 103 | C79F710113325C64007B9A22 /* RootViewController.xib */, 104 | C79F70F013325C64007B9A22 /* Supporting Files */, 105 | ); 106 | path = PasscodeSample; 107 | sourceTree = ""; 108 | }; 109 | C79F70F013325C64007B9A22 /* Supporting Files */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | C79F70F113325C64007B9A22 /* PasscodeSample-Info.plist */, 113 | C79F70F213325C64007B9A22 /* InfoPlist.strings */, 114 | C79F70F513325C64007B9A22 /* PasscodeSample-Prefix.pch */, 115 | C79F70F613325C64007B9A22 /* main.m */, 116 | ); 117 | name = "Supporting Files"; 118 | sourceTree = ""; 119 | }; 120 | /* End PBXGroup section */ 121 | 122 | /* Begin PBXNativeTarget section */ 123 | C79F70E413325C64007B9A22 /* PasscodeSample */ = { 124 | isa = PBXNativeTarget; 125 | buildConfigurationList = C79F710613325C64007B9A22 /* Build configuration list for PBXNativeTarget "PasscodeSample" */; 126 | buildPhases = ( 127 | C79F70E113325C64007B9A22 /* Sources */, 128 | C79F70E213325C64007B9A22 /* Frameworks */, 129 | C79F70E313325C64007B9A22 /* Resources */, 130 | ); 131 | buildRules = ( 132 | ); 133 | dependencies = ( 134 | ); 135 | name = PasscodeSample; 136 | productName = PasscodeSample; 137 | productReference = C79F70E513325C64007B9A22 /* PasscodeSample.app */; 138 | productType = "com.apple.product-type.application"; 139 | }; 140 | /* End PBXNativeTarget section */ 141 | 142 | /* Begin PBXProject section */ 143 | C79F70DC13325C64007B9A22 /* Project object */ = { 144 | isa = PBXProject; 145 | attributes = { 146 | ORGANIZATIONNAME = Koolistov; 147 | }; 148 | buildConfigurationList = C79F70DF13325C64007B9A22 /* Build configuration list for PBXProject "PasscodeSample" */; 149 | compatibilityVersion = "Xcode 3.2"; 150 | developmentRegion = English; 151 | hasScannedForEncodings = 0; 152 | knownRegions = ( 153 | en, 154 | ); 155 | mainGroup = C79F70DA13325C64007B9A22; 156 | productRefGroup = C79F70E613325C64007B9A22 /* Products */; 157 | projectDirPath = ""; 158 | projectRoot = ""; 159 | targets = ( 160 | C79F70E413325C64007B9A22 /* PasscodeSample */, 161 | ); 162 | }; 163 | /* End PBXProject section */ 164 | 165 | /* Begin PBXResourcesBuildPhase section */ 166 | C79F70E313325C64007B9A22 /* Resources */ = { 167 | isa = PBXResourcesBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | C79F70F413325C64007B9A22 /* InfoPlist.strings in Resources */, 171 | C79F70FD13325C64007B9A22 /* MainWindow.xib in Resources */, 172 | C79F710313325C64007B9A22 /* RootViewController.xib in Resources */, 173 | C79F710D13325C73007B9A22 /* KVPasscodeViewController.xib in Resources */, 174 | ); 175 | runOnlyForDeploymentPostprocessing = 0; 176 | }; 177 | /* End PBXResourcesBuildPhase section */ 178 | 179 | /* Begin PBXSourcesBuildPhase section */ 180 | C79F70E113325C64007B9A22 /* Sources */ = { 181 | isa = PBXSourcesBuildPhase; 182 | buildActionMask = 2147483647; 183 | files = ( 184 | C79F70F713325C64007B9A22 /* main.m in Sources */, 185 | C79F70FA13325C64007B9A22 /* PasscodeSampleAppDelegate.m in Sources */, 186 | C79F710013325C64007B9A22 /* RootViewController.m in Sources */, 187 | C79F710C13325C73007B9A22 /* KVPasscodeViewController.m in Sources */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | /* End PBXSourcesBuildPhase section */ 192 | 193 | /* Begin PBXVariantGroup section */ 194 | C79F70F213325C64007B9A22 /* InfoPlist.strings */ = { 195 | isa = PBXVariantGroup; 196 | children = ( 197 | C79F70F313325C64007B9A22 /* en */, 198 | ); 199 | name = InfoPlist.strings; 200 | sourceTree = ""; 201 | }; 202 | C79F70FB13325C64007B9A22 /* MainWindow.xib */ = { 203 | isa = PBXVariantGroup; 204 | children = ( 205 | C79F70FC13325C64007B9A22 /* en */, 206 | ); 207 | name = MainWindow.xib; 208 | sourceTree = ""; 209 | }; 210 | C79F710113325C64007B9A22 /* RootViewController.xib */ = { 211 | isa = PBXVariantGroup; 212 | children = ( 213 | C79F710213325C64007B9A22 /* en */, 214 | ); 215 | name = RootViewController.xib; 216 | sourceTree = ""; 217 | }; 218 | /* End PBXVariantGroup section */ 219 | 220 | /* Begin XCBuildConfiguration section */ 221 | C79F710413325C64007B9A22 /* Debug */ = { 222 | isa = XCBuildConfiguration; 223 | buildSettings = { 224 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 225 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 226 | GCC_C_LANGUAGE_STANDARD = gnu99; 227 | GCC_OPTIMIZATION_LEVEL = 0; 228 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG; 229 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 230 | GCC_VERSION = com.apple.compilers.llvmgcc42; 231 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 232 | GCC_WARN_UNUSED_VARIABLE = YES; 233 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 234 | SDKROOT = iphoneos; 235 | }; 236 | name = Debug; 237 | }; 238 | C79F710513325C64007B9A22 /* Release */ = { 239 | isa = XCBuildConfiguration; 240 | buildSettings = { 241 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 242 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 243 | GCC_C_LANGUAGE_STANDARD = gnu99; 244 | GCC_VERSION = com.apple.compilers.llvmgcc42; 245 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 246 | GCC_WARN_UNUSED_VARIABLE = YES; 247 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 248 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 249 | SDKROOT = iphoneos; 250 | }; 251 | name = Release; 252 | }; 253 | C79F710713325C64007B9A22 /* Debug */ = { 254 | isa = XCBuildConfiguration; 255 | buildSettings = { 256 | ALWAYS_SEARCH_USER_PATHS = NO; 257 | COPY_PHASE_STRIP = NO; 258 | GCC_DYNAMIC_NO_PIC = NO; 259 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 260 | GCC_PREFIX_HEADER = "PasscodeSample/PasscodeSample-Prefix.pch"; 261 | INFOPLIST_FILE = "PasscodeSample/PasscodeSample-Info.plist"; 262 | PRODUCT_NAME = "$(TARGET_NAME)"; 263 | WRAPPER_EXTENSION = app; 264 | }; 265 | name = Debug; 266 | }; 267 | C79F710813325C64007B9A22 /* Release */ = { 268 | isa = XCBuildConfiguration; 269 | buildSettings = { 270 | ALWAYS_SEARCH_USER_PATHS = NO; 271 | COPY_PHASE_STRIP = YES; 272 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 273 | GCC_PREFIX_HEADER = "PasscodeSample/PasscodeSample-Prefix.pch"; 274 | INFOPLIST_FILE = "PasscodeSample/PasscodeSample-Info.plist"; 275 | PRODUCT_NAME = "$(TARGET_NAME)"; 276 | VALIDATE_PRODUCT = YES; 277 | WRAPPER_EXTENSION = app; 278 | }; 279 | name = Release; 280 | }; 281 | /* End XCBuildConfiguration section */ 282 | 283 | /* Begin XCConfigurationList section */ 284 | C79F70DF13325C64007B9A22 /* Build configuration list for PBXProject "PasscodeSample" */ = { 285 | isa = XCConfigurationList; 286 | buildConfigurations = ( 287 | C79F710413325C64007B9A22 /* Debug */, 288 | C79F710513325C64007B9A22 /* Release */, 289 | ); 290 | defaultConfigurationIsVisible = 0; 291 | defaultConfigurationName = Release; 292 | }; 293 | C79F710613325C64007B9A22 /* Build configuration list for PBXNativeTarget "PasscodeSample" */ = { 294 | isa = XCConfigurationList; 295 | buildConfigurations = ( 296 | C79F710713325C64007B9A22 /* Debug */, 297 | C79F710813325C64007B9A22 /* Release */, 298 | ); 299 | defaultConfigurationIsVisible = 0; 300 | }; 301 | /* End XCConfigurationList section */ 302 | }; 303 | rootObject = C79F70DC13325C64007B9A22 /* Project object */; 304 | } 305 | -------------------------------------------------------------------------------- /PasscodeSample/PasscodeSample/en.lproj/RootViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 784 5 | 10J567 6 | 1305 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 300 12 | 13 | 14 | YES 15 | IBUIButton 16 | IBUIView 17 | IBUILabel 18 | IBProxyObject 19 | 20 | 21 | YES 22 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 23 | 24 | 25 | YES 26 | 27 | YES 28 | 29 | 30 | 31 | 32 | YES 33 | 34 | IBFilesOwner 35 | IBCocoaTouchFramework 36 | 37 | 38 | IBFirstResponder 39 | IBCocoaTouchFramework 40 | 41 | 42 | 43 | 292 44 | 45 | YES 46 | 47 | 48 | 292 49 | {{53, 132}, {215, 37}} 50 | 51 | 52 | 53 | NO 54 | IBCocoaTouchFramework 55 | 0 56 | 0 57 | 58 | Helvetica-Bold 59 | 15 60 | 16 61 | 62 | 1 63 | Show Passcode Controller 64 | 65 | 3 66 | MQA 67 | 68 | 69 | 1 70 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 71 | 72 | 73 | 3 74 | MC41AA 75 | 76 | 77 | 78 | 79 | 292 80 | {{20, 20}, {280, 31}} 81 | 82 | 83 | 84 | 85 | 3 86 | MCAwAA 87 | 88 | NO 89 | YES 90 | 7 91 | NO 92 | IBCocoaTouchFramework 93 | PasscodeSample 94 | 95 | Helvetica-Bold 96 | 17 97 | 16 98 | 99 | 100 | 1 101 | MC4yNTg4MjM1Mjk0IDAuMzMzMzMzMzMzMyAwLjQAA 102 | 103 | 104 | 105 | 1 106 | MSAxIDEAA 107 | 108 | {0, 1} 109 | 1 110 | 10 111 | 1 112 | 113 | 114 | 115 | 292 116 | {{20, 59}, {280, 53}} 117 | 118 | 119 | 120 | 121 | NO 122 | YES 123 | 7 124 | NO 125 | IBCocoaTouchFramework 126 | Q2xpY2sgdGhlIGJ1dHRvbiBiZWxvdyB0byBzaG93IHRoZSBjb250cm9sbGVyLiBUaGUgcGFzc2NvZGUg 127 | aXMgc2V0IHRvICcxMjM0Jy4gClRyeSAnMDAwMCcgZm9yIGNvbmZpcm1hdGlvbiBhbmltYXRpb24uA 128 | 129 | Helvetica 130 | 14 131 | 16 132 | 133 | 134 | 1 135 | MC4yNTg4MjM1Mjk0IDAuMzMzMzMzMzMzMyAwLjQAA 136 | 137 | 138 | 139 | {0, 1} 140 | 1 141 | 10 142 | 0 143 | 1 144 | 145 | 146 | 147 | 292 148 | {{20, 399}, {280, 41}} 149 | 150 | 151 | 152 | 153 | NO 154 | YES 155 | 7 156 | NO 157 | IBCocoaTouchFramework 158 | © 2011 Koolistov 159 | 160 | 161 | 1 162 | MC4yNTg4MjM1Mjk0IDAuMzMzMzMzMzMzMyAwLjQAA 163 | 164 | 165 | 166 | {0, 1} 167 | 1 168 | 10 169 | 0 170 | 1 171 | 172 | 173 | {{0, 20}, {320, 460}} 174 | 175 | 176 | 177 | 178 | 10 179 | 180 | 549453824 181 | {84, 1} 182 | 183 | YES 184 | 185 | YES 186 | 187 | 188 | 189 | TU0AKgAAAVjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ 190 | y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ 191 | xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ 192 | xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ 193 | xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ 194 | xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P8ADQEAAAMAAAABAFQAAAEB 195 | AAMAAAABAAEAAAECAAMAAAAEAAAB+gEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES 196 | AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABAAEAAAEXAAQAAAABAAABUAEcAAMAAAABAAEAAAFS 197 | AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA 198 | 199 | 200 | 201 | 202 | 203 | 204 | groupTableViewBackgroundColor 205 | 206 | 207 | IBCocoaTouchFramework 208 | 209 | 210 | 211 | 212 | YES 213 | 214 | 215 | showPasscode: 216 | 217 | 218 | 7 219 | 220 | 13 221 | 222 | 223 | 224 | view 225 | 226 | 227 | 228 | 14 229 | 230 | 231 | 232 | 233 | YES 234 | 235 | 0 236 | 237 | 238 | 239 | 240 | 241 | -1 242 | 243 | 244 | File's Owner 245 | 246 | 247 | -2 248 | 249 | 250 | 251 | 252 | 6 253 | 254 | 255 | YES 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 7 265 | 266 | 267 | 268 | 269 | 8 270 | 271 | 272 | 273 | 274 | 9 275 | 276 | 277 | 278 | 279 | 12 280 | 281 | 282 | 283 | 284 | 285 | 286 | YES 287 | 288 | YES 289 | -1.CustomClassName 290 | -2.CustomClassName 291 | 12.IBPluginDependency 292 | 6.IBPluginDependency 293 | 7.IBPluginDependency 294 | 8.IBPluginDependency 295 | 9.IBPluginDependency 296 | 297 | 298 | YES 299 | RootViewController 300 | UIResponder 301 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 302 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 303 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 304 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 305 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 306 | 307 | 308 | 309 | YES 310 | 311 | 312 | 313 | 314 | 315 | YES 316 | 317 | 318 | 319 | 320 | 14 321 | 322 | 323 | 324 | YES 325 | 326 | RootViewController 327 | UIViewController 328 | 329 | showPasscode: 330 | id 331 | 332 | 333 | showPasscode: 334 | 335 | showPasscode: 336 | id 337 | 338 | 339 | 340 | IBProjectSource 341 | ./Classes/RootViewController.h 342 | 343 | 344 | 345 | 346 | 0 347 | IBCocoaTouchFramework 348 | 349 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 350 | 351 | 352 | 353 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 354 | 355 | 356 | YES 357 | 3 358 | 300 359 | 360 | 361 | -------------------------------------------------------------------------------- /KVPasscodeViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 1305 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 300 12 | 13 | 14 | YES 15 | IBUITextField 16 | IBUIView 17 | IBUILabel 18 | IBProxyObject 19 | 20 | 21 | YES 22 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 23 | 24 | 25 | YES 26 | 27 | YES 28 | 29 | 30 | 31 | 32 | YES 33 | 34 | IBFilesOwner 35 | IBCocoaTouchFramework 36 | 37 | 38 | IBFirstResponder 39 | IBCocoaTouchFramework 40 | 41 | 42 | 43 | 274 44 | 45 | YES 46 | 47 | 48 | 292 49 | 50 | YES 51 | 52 | 53 | 292 54 | {{20, 20}, {280, 31}} 55 | 56 | 57 | 58 | 3 59 | MCAwAA 60 | 61 | NO 62 | YES 63 | 7 64 | NO 65 | IBCocoaTouchFramework 66 | Enter your passcode: 67 | 68 | Helvetica-Bold 69 | 17 70 | 16 71 | 72 | 73 | 1 74 | MC4yNTg4MjM1Mjk0IDAuMzMzMzMzMzMzMyAwLjQAA 75 | 76 | 77 | 78 | 1 79 | MSAxIDEAA 80 | 81 | {0, 1} 82 | 1 83 | 10 84 | 1 85 | 86 | 87 | 88 | 292 89 | {{30, 71}, {56, 56}} 90 | 91 | 92 | 93 | 3 94 | MQA 95 | 96 | NO 97 | YES 98 | IBCocoaTouchFramework 99 | NO 100 | 0 101 | 102 | 2 103 | 104 | 3 105 | MAA 106 | 107 | 2 108 | 109 | 110 | 111 | Helvetica 112 | 32 113 | 16 114 | 115 | 1 116 | 117 | 4 118 | YES 119 | IBCocoaTouchFramework 120 | 121 | 122 | 123 | 124 | 292 125 | {{98, 71}, {56, 56}} 126 | 127 | 128 | 129 | NO 130 | YES 131 | 1 132 | IBCocoaTouchFramework 133 | NO 134 | 0 135 | 136 | 2 137 | 138 | 3 139 | MAA 140 | 141 | 142 | 143 | 1 144 | 145 | 4 146 | YES 147 | IBCocoaTouchFramework 148 | 149 | 150 | 151 | 152 | 292 153 | {{166, 71}, {56, 56}} 154 | 155 | 156 | 157 | NO 158 | YES 159 | 2 160 | IBCocoaTouchFramework 161 | NO 162 | 0 163 | 164 | 2 165 | 166 | 3 167 | MAA 168 | 169 | 170 | 171 | 1 172 | 173 | 4 174 | YES 175 | IBCocoaTouchFramework 176 | 177 | 178 | 179 | 180 | 292 181 | {{234, 71}, {56, 56}} 182 | 183 | 184 | 185 | NO 186 | YES 187 | 3 188 | IBCocoaTouchFramework 189 | NO 190 | 0 191 | 192 | 2 193 | 194 | 3 195 | MAA 196 | 197 | 198 | 199 | 1 200 | 201 | 4 202 | YES 203 | IBCocoaTouchFramework 204 | 205 | 206 | 207 | 208 | 292 209 | {{20, 143}, {280, 41}} 210 | 211 | 212 | 213 | NO 214 | YES 215 | 7 216 | NO 217 | IBCocoaTouchFramework 218 | 219 | 220 | Helvetica 221 | 14 222 | 16 223 | 224 | 225 | 1 226 | MC4yNTg4MjM1Mjk0IDAuMzMzMzMzMzMzMyAwLjQAA 227 | 228 | 229 | 230 | {0, 1} 231 | 1 232 | 10 233 | 0 234 | 1 235 | 236 | 237 | {320, 204} 238 | 239 | 240 | 3 241 | MCAwAA 242 | 243 | IBCocoaTouchFramework 244 | 245 | 246 | {{0, 64}, {320, 416}} 247 | 248 | 249 | 250 | 10 251 | 252 | 549453824 253 | {84, 1} 254 | 255 | YES 256 | 257 | YES 258 | 259 | 260 | 261 | TU0AKgAAAVjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ 262 | y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ 263 | xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ 264 | xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ 265 | xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ 266 | xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P8ADQEAAAMAAAABAFQAAAEB 267 | AAMAAAABAAEAAAECAAMAAAAEAAAB+gEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES 268 | AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABAAEAAAEXAAQAAAABAAABUAEcAAMAAAABAAEAAAFS 269 | AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA 270 | 271 | 272 | 273 | 274 | 275 | 276 | groupTableViewBackgroundColor 277 | 278 | 279 | 280 | NO 281 | 282 | IBCocoaTouchFramework 283 | 284 | 285 | 286 | 287 | YES 288 | 289 | 290 | view 291 | 292 | 293 | 294 | 3 295 | 296 | 297 | 298 | titleLabel 299 | 300 | 301 | 302 | 18 303 | 304 | 305 | 306 | instructionLabel 307 | 308 | 309 | 310 | 19 311 | 312 | 313 | 314 | bulletField0 315 | 316 | 317 | 318 | 20 319 | 320 | 321 | 322 | bulletField1 323 | 324 | 325 | 326 | 21 327 | 328 | 329 | 330 | bulletField2 331 | 332 | 333 | 334 | 22 335 | 336 | 337 | 338 | bulletField3 339 | 340 | 341 | 342 | 23 343 | 344 | 345 | 346 | animationView 347 | 348 | 349 | 350 | 26 351 | 352 | 353 | 354 | 355 | YES 356 | 357 | 0 358 | 359 | 360 | 361 | 362 | 363 | 1 364 | 365 | 366 | YES 367 | 368 | 369 | 370 | 371 | 372 | -1 373 | 374 | 375 | File's Owner 376 | 377 | 378 | -2 379 | 380 | 381 | 382 | 383 | 24 384 | 385 | 386 | YES 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 8 398 | 399 | 400 | 401 | 402 | 4 403 | 404 | 405 | 406 | 407 | 12 408 | 409 | 410 | 411 | 412 | 14 413 | 414 | 415 | 416 | 417 | 16 418 | 419 | 420 | 421 | 422 | 10 423 | 424 | 425 | 426 | 427 | 428 | 429 | YES 430 | 431 | YES 432 | -1.CustomClassName 433 | -2.CustomClassName 434 | 1.IBEditorWindowLastContentRect 435 | 1.IBPluginDependency 436 | 10.IBPluginDependency 437 | 12.IBPluginDependency 438 | 14.IBPluginDependency 439 | 16.IBPluginDependency 440 | 4.IBPluginDependency 441 | 8.IBPluginDependency 442 | 443 | 444 | YES 445 | KVPasscodeViewController 446 | UIResponder 447 | {{556, 412}, {320, 480}} 448 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 449 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 450 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 451 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 452 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 453 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 454 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 455 | 456 | 457 | 458 | YES 459 | 460 | 461 | 462 | 463 | 464 | YES 465 | 466 | 467 | 468 | 469 | 26 470 | 471 | 472 | 0 473 | IBCocoaTouchFramework 474 | 475 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 476 | 477 | 478 | YES 479 | 3 480 | 300 481 | 482 | 483 | --------------------------------------------------------------------------------