├── CoreLock ├── 1.png ├── core.gif ├── CoreLock │ ├── Lib │ │ ├── View │ │ │ ├── CLLockMainView.h │ │ │ ├── CLLockInfoView.h │ │ │ ├── CLLockLabel.h │ │ │ ├── CLLockItemView.h │ │ │ ├── CLLockLabel.m │ │ │ ├── CLLockView.h │ │ │ ├── CLLockInfoView.m │ │ │ ├── CLLockMainView.m │ │ │ ├── CLLockItemView.m │ │ │ └── CLLockView.m │ │ ├── Controller │ │ │ ├── CLLockNavVC.h │ │ │ └── CLLockNavVC.m │ │ ├── Category │ │ │ ├── CALayer+Anim.h │ │ │ └── CALayer+Anim.m │ │ └── Const │ │ │ ├── CoreLockConst.m │ │ │ └── CoreLockConst.h │ ├── CLLockVC.h │ ├── CLLockVC.m │ └── CLLockVC.xib ├── ViewController.h ├── AppDelegate.h ├── main.m ├── Images.xcassets │ ├── LaunchImage.launchimage │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── FrameWork │ ├── CoreArchive │ │ ├── Category │ │ │ ├── NSString+File.h │ │ │ └── NSString+File.m │ │ ├── CoreArchive.h │ │ └── CoreArchive.m │ └── CoreExtend │ │ └── CoreConst.h ├── Info.plist ├── ViewController.m ├── AppDelegate.m └── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── CoreLock.xcodeproj ├── xcuserdata │ └── Charlin.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── CoreLock.xcscheme ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcuserdata │ │ └── Charlin.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcshareddata │ │ └── CoreLock.xccheckout └── project.pbxproj ├── CoreLockTests ├── Info.plist └── CoreLockTests.m └── README.md /CoreLock/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CharlinFeng/CoreLock/HEAD/CoreLock/1.png -------------------------------------------------------------------------------- /CoreLock/core.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CharlinFeng/CoreLock/HEAD/CoreLock/core.gif -------------------------------------------------------------------------------- /CoreLock.xcodeproj/xcuserdata/Charlin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /CoreLock.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CoreLock.xcodeproj/project.xcworkspace/xcuserdata/Charlin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CharlinFeng/CoreLock/HEAD/CoreLock.xcodeproj/project.xcworkspace/xcuserdata/Charlin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/View/CLLockMainView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockMainView.h 3 | // CoreLock 4 | // 5 | // Created by 冯成林 on 15/4/28. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CLLockMainView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CoreLock/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/21. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/View/CLLockInfoView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockInfoView.h 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/27. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 仅仅是做展示用 8 | 9 | #import 10 | 11 | @interface CLLockInfoView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/Controller/CLLockNavVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockNavVC.h 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/28. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CLLockNavVC : UINavigationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CoreLock/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/21. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/Category/CALayer+Anim.h: -------------------------------------------------------------------------------- 1 | // 2 | // CALayer+Anim.h 3 | // CoreLock 4 | // 5 | // Created by 冯成林 on 15/4/28. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CALayer (Anim) 12 | 13 | 14 | 15 | /* 16 | * 摇动 17 | */ 18 | -(void)shake; 19 | 20 | 21 | 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /CoreLock/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/21. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/View/CLLockLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockLabel.h 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/27. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CLLockLabel : UILabel 12 | 13 | 14 | 15 | /* 16 | * 普通提示信息 17 | */ 18 | -(void)showNormalMsg:(NSString *)msg; 19 | 20 | 21 | 22 | /* 23 | * 警示信息 24 | */ 25 | -(void)showWarnMsg:(NSString *)msg; 26 | 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /CoreLock/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "minimum-system-version" : "7.0", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "orientation" : "portrait", 11 | "idiom" : "iphone", 12 | "minimum-system-version" : "7.0", 13 | "subtype" : "retina4", 14 | "scale" : "2x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /CoreLock/FrameWork/CoreArchive/Category/NSString+File.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+File.h 3 | // CoreCategory 4 | // 5 | // Created by 成林 on 15/4/6. 6 | // Copyright (c) 2015年 沐汐. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | 13 | @interface NSString (File) 14 | 15 | 16 | /* 17 | * document根文件夹 18 | */ 19 | +(NSString *)documentFolder; 20 | 21 | 22 | /* 23 | * caches根文件夹 24 | */ 25 | +(NSString *)cachesFolder; 26 | 27 | 28 | 29 | 30 | /** 31 | * 生成子文件夹 32 | * 33 | * 如果子文件夹不存在,则直接创建;如果已经存在,则直接返回 34 | * 35 | * @param subFolder 子文件夹名 36 | * 37 | * @return 文件夹路径 38 | */ 39 | -(NSString *)createSubFolder:(NSString *)subFolder; 40 | 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /CoreLock.xcodeproj/xcuserdata/Charlin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CoreLock.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 893F1FEB1AE68CF1009D6A35 16 | 17 | primary 18 | 19 | 20 | 893F20041AE68CF1009D6A35 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/Category/CALayer+Anim.m: -------------------------------------------------------------------------------- 1 | // 2 | // CALayer+Anim.m 3 | // CoreLock 4 | // 5 | // Created by 冯成林 on 15/4/28. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import "CALayer+Anim.h" 10 | 11 | @implementation CALayer (Anim) 12 | 13 | 14 | /* 15 | * 摇动 16 | */ 17 | -(void)shake{ 18 | 19 | CAKeyframeAnimation *kfa = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.x"]; 20 | 21 | CGFloat s = 16; 22 | 23 | kfa.values = @[@(-s),@(0),@(s),@(0),@(-s),@(0),@(s),@(0)]; 24 | 25 | //时长 26 | kfa.duration = .1f; 27 | 28 | //重复 29 | kfa.repeatCount =2; 30 | 31 | //移除 32 | kfa.removedOnCompletion = YES; 33 | 34 | [self addAnimation:kfa forKey:@"shake"]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /CoreLock/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /CoreLockTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | HM.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/Controller/CLLockNavVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockNavVC.m 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/28. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import "CLLockNavVC.h" 10 | 11 | @interface CLLockNavVC () 12 | 13 | @end 14 | 15 | @implementation CLLockNavVC 16 | 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | [self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont systemFontOfSize:20]}]; 22 | 23 | [self.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault]; 24 | 25 | //tintColor 26 | self.navigationBar.tintColor = [UIColor whiteColor]; 27 | } 28 | 29 | 30 | -(UIStatusBarStyle)preferredStatusBarStyle{ 31 | return UIStatusBarStyleLightContent; 32 | } 33 | 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/View/CLLockItemView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockItemView.h 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/21. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | typedef enum { 13 | 14 | //正上 15 | LockItemViewDirecTop=1, 16 | 17 | //右上 18 | LockItemViewDirecRightTop, 19 | 20 | //右 21 | LockItemViewDirecRight, 22 | 23 | //右下 24 | LockItemViewDiretRightBottom, 25 | 26 | //下 27 | LockItemViewDirecBottom, 28 | 29 | //左下 30 | LockItemViewDirecLeftBottom, 31 | 32 | //左 33 | LockItemViewDirecLeft, 34 | 35 | //左上 36 | LockItemViewDirecLeftTop, 37 | 38 | }LockItemViewDirect; 39 | 40 | 41 | 42 | 43 | @interface CLLockItemView : UIView 44 | 45 | 46 | 47 | 48 | /** 是否选中 */ 49 | @property (nonatomic,assign) BOOL selected; 50 | 51 | 52 | 53 | /** 方向 */ 54 | @property (nonatomic,assign) LockItemViewDirect direct; 55 | 56 | 57 | 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /CoreLockTests/CoreLockTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // CoreLockTests.m 3 | // CoreLockTests 4 | // 5 | // Created by 成林 on 15/4/21. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface CoreLockTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation CoreLockTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /CoreLock/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | HM.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/View/CLLockLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockLabel.m 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/27. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import "CLLockLabel.h" 10 | #import "CoreLockConst.h" 11 | #import "CALayer+Anim.h" 12 | 13 | 14 | 15 | @implementation CLLockLabel 16 | 17 | 18 | 19 | 20 | -(instancetype)initWithFrame:(CGRect)frame{ 21 | 22 | self = [super initWithFrame:frame]; 23 | 24 | if(self){ 25 | 26 | //视图初始化 27 | [self viewPrepare]; 28 | } 29 | 30 | return self; 31 | } 32 | 33 | 34 | 35 | -(id)initWithCoder:(NSCoder *)aDecoder{ 36 | 37 | self=[super initWithCoder:aDecoder]; 38 | 39 | if(self){ 40 | 41 | //视图初始化 42 | [self viewPrepare]; 43 | } 44 | 45 | return self; 46 | } 47 | 48 | 49 | /* 50 | * 视图初始化 51 | */ 52 | -(void)viewPrepare{ 53 | 54 | self.font = [UIFont systemFontOfSize:16.0f]; 55 | } 56 | 57 | 58 | 59 | 60 | 61 | /* 62 | * 普通提示信息 63 | */ 64 | -(void)showNormalMsg:(NSString *)msg{ 65 | 66 | self.text = msg; 67 | self.textColor = CoreLockCircleLineNormalColor; 68 | } 69 | 70 | 71 | 72 | /* 73 | * 警示信息 74 | */ 75 | -(void)showWarnMsg:(NSString *)msg{ 76 | 77 | self.text = msg; 78 | self.textColor = CoreLockWarnColor; 79 | 80 | //添加一个shake动画 81 | [self.layer shake]; 82 | } 83 | 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/CLLockVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockVC.h 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/21. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum{ 12 | 13 | //设置密码 14 | CoreLockTypeSetPwd=0, 15 | 16 | //输入并验证密码 17 | CoreLockTypeVeryfiPwd, 18 | 19 | //修改密码 20 | CoreLockTypeModifyPwd, 21 | 22 | }CoreLockType; 23 | 24 | 25 | 26 | @interface CLLockVC : UIViewController 27 | 28 | @property (nonatomic,assign) CoreLockType type; 29 | 30 | 31 | 32 | /* 33 | * 是否有本地密码缓存?即用户是否设置过初始密码? 34 | */ 35 | +(BOOL)hasPwd; 36 | 37 | 38 | 39 | 40 | 41 | /* 42 | * 展示设置密码控制器 43 | */ 44 | +(instancetype)showSettingLockVCInVC:(UIViewController *)vc successBlock:(void(^)(CLLockVC *lockVC, NSString *pwd))successBlock; 45 | 46 | 47 | 48 | /* 49 | * 展示验证密码输入框 50 | */ 51 | +(instancetype)showVerifyLockVCInVC:(UIViewController *)vc forgetPwdBlock:(void(^)())forgetPwdBlock successBlock:(void(^)(CLLockVC *lockVC, NSString *pwd))successBlock; 52 | 53 | 54 | 55 | /* 56 | * 展示验证密码输入框 57 | */ 58 | +(instancetype)showModifyLockVCInVC:(UIViewController *)vc successBlock:(void(^)(CLLockVC *lockVC, NSString *pwd))successBlock; 59 | 60 | 61 | /* 62 | * 消失 63 | */ 64 | -(void)dismiss:(NSTimeInterval)interval; 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/Const/CoreLockConst.m: -------------------------------------------------------------------------------- 1 | // 2 | // CoreLockConst.m 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/24. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #ifndef _CoreLockConst_H_ 10 | #define _CoreLockConst_H_ 11 | 12 | #import 13 | 14 | /** 选中圆大小比例 */ 15 | const CGFloat CoreLockArcWHR = .3f; 16 | 17 | 18 | /** 选中圆大小的线宽 */ 19 | const CGFloat CoreLockArcLineW = 1.0f; 20 | 21 | 22 | /** 密码存储Key */ 23 | NSString *const CoreLockPWDKey = @"CoreLockPWDKey"; 24 | 25 | 26 | /* 27 | * 设置密码 28 | */ 29 | 30 | 31 | /** 最低设置密码数目 */ 32 | const NSUInteger CoreLockMinItemCount = 4; 33 | 34 | 35 | /** 设置密码提示文字 */ 36 | NSString *const CoreLockPWDTitleFirst = @"请滑动设置新密码"; 37 | 38 | 39 | 40 | /** 设置密码提示文字:确认 */ 41 | NSString *const CoreLockPWDTitleConfirm = @"请再次输入确认密码"; 42 | 43 | 44 | /** 设置密码提示文字:再次密码不一致 */ 45 | NSString *const CoreLockPWDDiffTitle = @"再次密码输入不一致"; 46 | 47 | /** 设置密码提示文字:设置成功 */ 48 | NSString *const CoreLockPWSuccessTitle = @"密码设置成功!"; 49 | 50 | 51 | /* 52 | * 验证密码 53 | */ 54 | 55 | /** 验证密码:普通提示文字 */ 56 | NSString *const CoreLockVerifyNormalTitle = @"请滑动输入密码"; 57 | 58 | 59 | /** 验证密码:密码错误 */ 60 | NSString *const CoreLockVerifyErrorPwdTitle = @"输入密码错误"; 61 | 62 | 63 | /** 验证密码:验证成功 */ 64 | NSString *const CoreLockVerifySuccesslTitle = @"密码正确"; 65 | 66 | 67 | /* 68 | * 修改密码 69 | */ 70 | /** 修改密码:普通提示文字 */ 71 | NSString *const CoreLockModifyNormalTitle = @"请输入旧密码"; 72 | 73 | 74 | 75 | 76 | #endif -------------------------------------------------------------------------------- /CoreLock/FrameWork/CoreArchive/Category/NSString+File.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+File.m 3 | // CoreCategory 4 | // 5 | // Created by 成林 on 15/4/6. 6 | // Copyright (c) 2015年 沐汐. All rights reserved. 7 | // 8 | 9 | #import "NSString+File.h" 10 | 11 | @implementation NSString (File) 12 | 13 | /* 14 | * document根文件夹 15 | */ 16 | +(NSString *)documentFolder{ 17 | 18 | return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; 19 | } 20 | 21 | 22 | 23 | /* 24 | * caches根文件夹 25 | */ 26 | +(NSString *)cachesFolder{ 27 | 28 | return [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]; 29 | } 30 | 31 | 32 | 33 | 34 | 35 | /** 36 | * 生成子文件夹 37 | * 38 | * 如果子文件夹不存在,则直接创建;如果已经存在,则直接返回 39 | * 40 | * @param subFolder 子文件夹名 41 | * 42 | * @return 文件夹路径 43 | */ 44 | -(NSString *)createSubFolder:(NSString *)subFolder{ 45 | 46 | NSString *subFolderPath=[NSString stringWithFormat:@"%@/%@",self,subFolder]; 47 | 48 | BOOL isDir = NO; 49 | 50 | NSFileManager *fileManager = [NSFileManager defaultManager]; 51 | 52 | BOOL existed = [fileManager fileExistsAtPath:subFolderPath isDirectory:&isDir]; 53 | 54 | if ( !(isDir == YES && existed == YES) ) 55 | { 56 | [fileManager createDirectoryAtPath:subFolderPath withIntermediateDirectories:YES attributes:nil error:nil]; 57 | } 58 | 59 | return subFolderPath; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /CoreLock/FrameWork/CoreArchive/CoreArchive.h: -------------------------------------------------------------------------------- 1 | // 2 | // ToolArc.h 3 | // 私人通讯录 4 | // 5 | // Created by muxi on 14-9-3. 6 | // Copyright (c) 2014年 muxi. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "NSString+File.h" 12 | 13 | 14 | @interface CoreArchive : NSObject 15 | 16 | #pragma mark - 偏好类信息存储 17 | 18 | /** 19 | * 保存普通字符串 20 | */ 21 | +(void)setStr:(NSString *)str key:(NSString *)key; 22 | 23 | /** 24 | * 读取 25 | */ 26 | +(NSString *)strForKey:(NSString *)key; 27 | 28 | /** 29 | * 删除 30 | */ 31 | +(void)removeStrForKey:(NSString *)key; 32 | 33 | 34 | /** 35 | * 保存int 36 | */ 37 | +(void)setInt:(NSInteger)i key:(NSString *)key; 38 | 39 | /** 40 | * 读取int 41 | */ 42 | +(NSInteger)intForKey:(NSString *)key; 43 | 44 | 45 | 46 | /** 47 | * 保存float 48 | */ 49 | +(void)setFloat:(CGFloat)floatValue key:(NSString *)key; 50 | 51 | /** 52 | * 读取float 53 | */ 54 | +(CGFloat)floatForKey:(NSString *)key; 55 | 56 | 57 | 58 | /** 59 | * 保存bool 60 | */ 61 | +(void)setBool:(BOOL)boolValue key:(NSString *)key; 62 | 63 | /** 64 | * 读取bool 65 | */ 66 | +(BOOL)boolForKey:(NSString *)key; 67 | 68 | 69 | #pragma mark - 文件归档 70 | 71 | /** 72 | * 归档 73 | */ 74 | +(BOOL)archiveRootObject:(id)obj toFile:(NSString *)path; 75 | /** 76 | * 删除 77 | */ 78 | +(BOOL)removeRootObjectWithFile:(NSString *)path; 79 | 80 | /** 81 | * 解档 82 | */ 83 | +(id)unarchiveObjectWithFile:(NSString *)path; 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/View/CLLockView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockView.h 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/21. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CLLockVC.h" 11 | 12 | @interface CLLockView : UIView 13 | 14 | @property (nonatomic,assign) CoreLockType type; 15 | 16 | 17 | 18 | /* 19 | * 设置密码 20 | */ 21 | 22 | /** 开始输入,第一次 */ 23 | @property (nonatomic,copy) void (^setPWBeginBlock)(); 24 | 25 | /** 开始输入,确认密码*/ 26 | @property (nonatomic,copy) void (^setPWConfirmlock)(); 27 | 28 | 29 | /** 设置密码出错:长度不够 */ 30 | @property (nonatomic,copy) void (^setPWSErrorLengthTooShortBlock)(NSUInteger currentCount); 31 | 32 | 33 | /** 设置密码出错:再次密码不一致 */ 34 | @property (nonatomic,copy) void (^setPWSErrorTwiceDiffBlock)(NSString *pwd1,NSString *pwdNow); 35 | 36 | 37 | /** 设置密码:第一次输入正确*/ 38 | @property (nonatomic,copy) void (^setPWFirstRightBlock)(); 39 | 40 | 41 | /** 再次密码输入一致 */ 42 | @property (nonatomic,copy) void (^setPWTwiceSameBlock)(NSString *pwd); 43 | 44 | 45 | /* 46 | * 重设密码 47 | */ 48 | -(void)resetPwd; 49 | 50 | 51 | /* 52 | * 验证密码 53 | */ 54 | 55 | /** 验证密码开始*/ 56 | @property (nonatomic,copy) void (^verifyPWBeginBlock)(); 57 | 58 | /** 验证密码 */ 59 | @property (nonatomic,copy) BOOL (^verifyPwdBlock)(NSString *pwd); 60 | 61 | 62 | /* 63 | * 修改密码 64 | */ 65 | /** 再次密码输入一致 */ 66 | @property (nonatomic,copy) void (^modifyPwdBlock)(); 67 | 68 | 69 | /** 密码修改成功 */ 70 | @property (nonatomic,copy) void (^modifyPwdSuccessBlock)(); 71 | 72 | 73 | 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/View/CLLockInfoView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockInfoView.m 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/27. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import "CLLockInfoView.h" 10 | #import "CoreLockConst.h" 11 | 12 | 13 | 14 | 15 | 16 | @implementation CLLockInfoView 17 | 18 | 19 | -(void)drawRect:(CGRect)rect{ 20 | 21 | //获取上下文 22 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 23 | 24 | //设置属性 25 | CGContextSetLineWidth(ctx, CoreLockArcLineW); 26 | 27 | //设置线条颜色 28 | [CoreLockCircleLineNormalColor set]; 29 | 30 | //新建路径 31 | CGMutablePathRef pathM =CGPathCreateMutable(); 32 | 33 | CGFloat marginV = 3.f; 34 | CGFloat padding = 1.0f; 35 | CGFloat rectWH = (rect.size.width - marginV * 2 - padding*2) / 3; 36 | 37 | //添加圆形路径 38 | for (NSUInteger i=0; i<9; i++) { 39 | 40 | NSUInteger row = i % 3; 41 | NSUInteger col = i / 3; 42 | 43 | CGFloat rectX = (rectWH + marginV) * row + padding; 44 | 45 | CGFloat rectY = (rectWH + marginV) * col + padding; 46 | 47 | CGRect rect = CGRectMake(rectX, rectY, rectWH, rectWH); 48 | 49 | CGPathAddEllipseInRect(pathM, NULL, rect); 50 | } 51 | 52 | //添加路径 53 | CGContextAddPath(ctx, pathM); 54 | 55 | //绘制路径 56 | CGContextStrokePath(ctx); 57 | 58 | //释放路径 59 | CGPathRelease(pathM); 60 | } 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /CoreLock/FrameWork/CoreExtend/CoreConst.h: -------------------------------------------------------------------------------- 1 | //全局通用常量定义,结尾请不要使用;号 2 | 3 | 4 | //ios系统版本 5 | #define ios8x [[[UIDevice currentDevice] systemVersion] floatValue] >=8.0f 6 | #define ios7x ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0f) && ([[[UIDevice currentDevice] systemVersion] floatValue] < 8.0f) 7 | #define ios6x [[[UIDevice currentDevice] systemVersion] floatValue] < 7.0f 8 | #define iosNot6x [[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0f 9 | 10 | 11 | #define iphone4x_3_5 ([UIScreen mainScreen].bounds.size.height==480.0f) 12 | 13 | #define iphone5x_4_0 ([UIScreen mainScreen].bounds.size.height==568.0f) 14 | 15 | #define iphone6_4_7 ([UIScreen mainScreen].bounds.size.height==667.0f) 16 | 17 | #define iphone6Plus_5_5 ([UIScreen mainScreen].bounds.size.height==736.0f || [UIScreen mainScreen].bounds.size.height==414.0f) 18 | 19 | //屏幕宽高 20 | #define kScreenW [[UIScreen mainScreen] bounds].size.width 21 | #define kScreenH [[UIScreen mainScreen] bounds].size.height 22 | 23 | //屏幕frame,bounds,size 24 | #define kScreenFrame [UIScreen mainScreen].bounds 25 | #define kScreenBounds [UIScreen mainScreen].bounds 26 | #define kScreenSize [UIScreen mainScreen].bounds.size 27 | 28 | 29 | 30 | #define rgb(r,g,b) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:1.0f] 31 | #define rgba(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a] 32 | #define hexColor(colorV) [UIColor colorWithHexColorString:@#colorV] 33 | #define hexColorAlpha(colorV,a) [UIColor colorWithHexColorString:@#colorV alpha:a]; 34 | 35 | 36 | #define StringFromInteger(i) [NSString stringWithFormat:@"%@",@(i)] 37 | 38 | 39 | -------------------------------------------------------------------------------- /CoreLock.xcodeproj/project.xcworkspace/xcshareddata/CoreLock.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 9D3BC158-F7EF-4241-9F64-3C20F439C2FF 9 | IDESourceControlProjectName 10 | CoreLock 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 204B8EFE146C0E80D77A4FDDF115AE9F3782E6BA 14 | https://github.com/nsdictionary/CoreLock.git 15 | 16 | IDESourceControlProjectPath 17 | CoreLock.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 204B8EFE146C0E80D77A4FDDF115AE9F3782E6BA 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/nsdictionary/CoreLock.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 204B8EFE146C0E80D77A4FDDF115AE9F3782E6BA 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 204B8EFE146C0E80D77A4FDDF115AE9F3782E6BA 36 | IDESourceControlWCCName 37 | CoreLock 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/View/CLLockMainView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockMainView.m 3 | // CoreLock 4 | // 5 | // Created by 冯成林 on 15/4/28. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import "CLLockMainView.h" 10 | #import "CoreConst.h" 11 | 12 | 13 | @interface CLLockMainView () 14 | 15 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *topC; 16 | 17 | 18 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomMarginC; 19 | 20 | 21 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *infoViewTopMoveC; 22 | 23 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *labelTopMarginC; 24 | 25 | 26 | @property (weak, nonatomic) IBOutlet UIButton *forgetBtn; 27 | 28 | 29 | @property (weak, nonatomic) IBOutlet UIButton *modifyBtn; 30 | 31 | 32 | 33 | @end 34 | 35 | 36 | 37 | @implementation CLLockMainView 38 | 39 | 40 | -(void)awakeFromNib{ 41 | 42 | [super awakeFromNib]; 43 | 44 | if(iphone4x_3_5){ 45 | 46 | _topC.constant =30; 47 | 48 | _bottomMarginC.constant = -30; 49 | 50 | _infoViewTopMoveC.constant = -10; 51 | 52 | _labelTopMarginC.constant = 10; 53 | } 54 | } 55 | 56 | 57 | 58 | -(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{ 59 | 60 | if(iphone4x_3_5){ 61 | 62 | CGRect forgetFrame = [_forgetBtn convertRect:_forgetBtn.bounds toView:self]; 63 | 64 | CGRect modifyFrame = [_modifyBtn convertRect:_modifyBtn.bounds toView:self]; 65 | 66 | if(CGRectContainsPoint(forgetFrame, point)) return _forgetBtn; 67 | if(CGRectContainsPoint(modifyFrame, point)) return _modifyBtn; 68 | } 69 | 70 | return [super hitTest:point withEvent:event]; 71 | } 72 | 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /CoreLock/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/21. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "CLLockVC.h" 11 | 12 | 13 | 14 | 15 | 16 | @interface ViewController () 17 | 18 | @end 19 | 20 | @implementation ViewController 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | 25 | 26 | 27 | } 28 | 29 | -(void)lockVC{ 30 | 31 | 32 | } 33 | 34 | 35 | /* 36 | * 设置密码 37 | */ 38 | - (IBAction)setPwd:(id)sender { 39 | 40 | 41 | BOOL hasPwd = [CLLockVC hasPwd]; 42 | hasPwd = NO; 43 | if(hasPwd){ 44 | 45 | NSLog(@"已经设置过密码了,你可以验证或者修改密码"); 46 | }else{ 47 | 48 | [CLLockVC showSettingLockVCInVC:self successBlock:^(CLLockVC *lockVC, NSString *pwd) { 49 | 50 | NSLog(@"密码设置成功"); 51 | [lockVC dismiss:1.0f]; 52 | }]; 53 | } 54 | } 55 | 56 | /* 57 | * 验证密码 58 | */ 59 | - (IBAction)verifyPwd:(id)sender { 60 | 61 | BOOL hasPwd = [CLLockVC hasPwd]; 62 | 63 | if(!hasPwd){ 64 | 65 | NSLog(@"你还没有设置密码,请先设置密码"); 66 | }else { 67 | 68 | [CLLockVC showVerifyLockVCInVC:self forgetPwdBlock:^{ 69 | NSLog(@"忘记密码"); 70 | } successBlock:^(CLLockVC *lockVC, NSString *pwd) { 71 | NSLog(@"密码正确"); 72 | [lockVC dismiss:1.0f]; 73 | }]; 74 | } 75 | } 76 | 77 | 78 | /* 79 | * 修改密码 80 | */ 81 | - (IBAction)modifyPwd:(id)sender { 82 | 83 | BOOL hasPwd = [CLLockVC hasPwd]; 84 | 85 | if(!hasPwd){ 86 | 87 | NSLog(@"你还没有设置密码,请先设置密码"); 88 | 89 | }else { 90 | 91 | [CLLockVC showModifyLockVCInVC:self successBlock:^(CLLockVC *lockVC, NSString *pwd) { 92 | 93 | [lockVC dismiss:.5f]; 94 | }]; 95 | } 96 | 97 | } 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /CoreLock/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/21. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/Const/CoreLockConst.h: -------------------------------------------------------------------------------- 1 | // 2 | // CoreLockConst.h 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/24. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | 13 | #ifndef _CoreLockConst_H_ 14 | #define _CoreLockConst_H_ 15 | 16 | 17 | #define rgba(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a] 18 | 19 | 20 | /* 21 | * 背景色 22 | */ 23 | #define CoreLockViewBgColor rgba(13,52,89,1) 24 | 25 | /* 26 | * 外环线条颜色:默认 27 | */ 28 | #define CoreLockCircleLineNormalColor rgba(241,241,241,1) 29 | 30 | 31 | /* 32 | * 外环线条颜色:选中 33 | */ 34 | #define CoreLockCircleLineSelectedColor rgba(34,178,246,1) 35 | 36 | 37 | /* 38 | * 实心圆 39 | */ 40 | #define CoreLockCircleLineSelectedCircleColor rgba(34,178,246,1) 41 | 42 | 43 | /* 44 | * 实心圆 45 | */ 46 | #define CoreLockLockLineColor rgba(34,178,246,1) 47 | 48 | 49 | 50 | /* 51 | * 警示文字颜色 52 | */ 53 | #define CoreLockWarnColor rgba(254,82,92,1) 54 | 55 | 56 | 57 | /** 选中圆大小比例 */ 58 | extern const CGFloat CoreLockArcWHR; 59 | 60 | 61 | 62 | /** 选中圆大小的线宽 */ 63 | extern const CGFloat CoreLockArcLineW; 64 | 65 | 66 | /** 密码存储Key */ 67 | extern NSString *const CoreLockPWDKey; 68 | 69 | 70 | /** 最低设置密码数目 */ 71 | extern const NSUInteger CoreLockMinItemCount; 72 | 73 | 74 | 75 | /* 76 | * 设置密码 77 | */ 78 | 79 | /** 设置密码提示文字:第一次 */ 80 | extern NSString *const CoreLockPWDTitleFirst; 81 | 82 | 83 | /** 设置密码提示文字:确认 */ 84 | extern NSString *const CoreLockPWDTitleConfirm; 85 | 86 | 87 | /** 设置密码提示文字:再次密码不一致 */ 88 | extern NSString *const CoreLockPWDDiffTitle; 89 | 90 | 91 | /** 设置密码提示文字:设置成功 */ 92 | extern NSString *const CoreLockPWSuccessTitle; 93 | 94 | 95 | 96 | /* 97 | * 验证密码 98 | */ 99 | 100 | /** 验证密码:普通提示文字 */ 101 | extern NSString *const CoreLockVerifyNormalTitle; 102 | 103 | 104 | /** 验证密码:密码错误 */ 105 | extern NSString *const CoreLockVerifyErrorPwdTitle; 106 | 107 | 108 | 109 | /** 验证密码:验证成功 */ 110 | extern NSString *const CoreLockVerifySuccesslTitle; 111 | 112 | 113 | 114 | /* 115 | * 修改密码 116 | */ 117 | /** 修改密码:普通提示文字 */ 118 | extern NSString *const CoreLockModifyNormalTitle; 119 | 120 | #endif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | Charlin出框架的目标:简单、易用、实用、高度封装、绝对解耦! 4 | 5 |

6 | 7 | 8 | 9 | CoreLock(关注[信息公告牌](https://github.com/CharlinFeng/Show)) 10 | =============== 11 | 高仿支付宝解锁!
12 | 13 | 注:本框架是高仿支付宝,并集成了所有功能,并非一个简单的解锁界面展示。个人制作用时1周多,打造解锁终结者框架。 14 | 15 | 16 | 17 |

18 | 示例截图 19 | =============== 20 | ![image](./CoreLock/core.gif)
21 |

22 | 23 | 24 | 框架特性: 25 | =============== 26 | >.ios版本兼容ios 7.0及以上.
27 | >.扁平化设计,全部使用QuartzCore引擎绘制,没有使用任何图片素材
28 | >.完全解耦,不需要继承,不需要定义成员属性,类方法直接搞定一切。
29 | >.自动管理生命周期,你只需要使用即可,不需要管理控制器的生命周期。
30 | >block封装,不需要任何代理
31 | >.完美屏幕适配,支持所有ios设备。
32 | >.做了比较多的性能优化,最大必的提高性能。
33 | >.完善的错误处理机制。
34 | 35 |

36 | Charlin想说: 37 | =============== 38 | 此版本是全部的QuartzCore绘制,整个框架使用了几乎所有的QuartzCore技术,如果你有兴趣,可以看下源代码, 39 | 算是一个比较不错的QuartzCore实战教程。 40 | 41 | 对于本框架,有以下技术点和大家分享:
42 | 1.主界面使用Xib定制,如果你需要添加控件,非常方便,比如支付宝顶部有用户头像,我这里没有,所以就没加,如果你需要加,直接在xib添加即可。
43 | 2.本地数据存储使用沙盒存储。
44 | 3.无任何代理设计,全程使用block解决,引用老刘的一句话,目前代理设计模式正在被块代码所逐步取代。
45 | 4.解锁线条绘制使用的是比较复杂的奇偶裁剪技术。有兴趣可以看看苹果官方示例。
46 | 5.关于QuartzCore,使用到的技术除了基本的绘制以外,还使用了图形上下文栈,矩阵变换,刷新图层等。
47 | 6.本框架考虑了添加密码,修改密码,验证密码,忘记密码等支付宝几乎全部的功能,并且使用简单。
48 | 49 | 50 | 51 | 52 | 53 |

54 | 55 | #### 使用示例 56 | 57 | /* 58 | * 设置密码 59 | */ 60 | - (IBAction)setPwd:(id)sender { 61 | 62 | 63 | BOOL hasPwd = [CLLockVC hasPwd]; 64 | hasPwd = NO; 65 | if(hasPwd){ 66 | 67 | NSLog(@"已经设置过密码了,你可以验证或者修改密码"); 68 | }else{ 69 | 70 | [CLLockVC showSettingLockVCInVC:self successBlock:^(CLLockVC *lockVC, NSString *pwd) { 71 | 72 | NSLog(@"密码设置成功"); 73 | [lockVC dismiss:1.0f]; 74 | }]; 75 | } 76 | } 77 | 78 | /* 79 | * 验证密码 80 | */ 81 | - (IBAction)verifyPwd:(id)sender { 82 | 83 | BOOL hasPwd = [CLLockVC hasPwd]; 84 | 85 | if(!hasPwd){ 86 | 87 | NSLog(@"你还没有设置密码,请先设置密码"); 88 | }else { 89 | 90 | [CLLockVC showVerifyLockVCInVC:self forgetPwdBlock:^{ 91 | NSLog(@"忘记密码"); 92 | } successBlock:^(CLLockVC *lockVC, NSString *pwd) { 93 | NSLog(@"密码正确"); 94 | [lockVC dismiss:1.0f]; 95 | }]; 96 | } 97 | } 98 | 99 | 100 | /* 101 | * 修改密码 102 | */ 103 | - (IBAction)modifyPwd:(id)sender { 104 | 105 | BOOL hasPwd = [CLLockVC hasPwd]; 106 | 107 | if(!hasPwd){ 108 | 109 | NSLog(@"你还没有设置密码,请先设置密码"); 110 | 111 | }else { 112 | 113 | [CLLockVC showModifyLockVCInVC:self successBlock:^(CLLockVC *lockVC, NSString *pwd) { 114 | 115 | [lockVC dismiss:.5f]; 116 | }]; 117 | } 118 | 119 | } 120 | 121 | 122 | 123 |

124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /CoreLock/FrameWork/CoreArchive/CoreArchive.m: -------------------------------------------------------------------------------- 1 | // 2 | // ToolArc.m 3 | // 私人通讯录 4 | // 5 | // Created by muxi on 14-9-3. 6 | // Copyright (c) 2014年 muxi. All rights reserved. 7 | // 8 | 9 | #import "CoreArchive.h" 10 | 11 | @implementation CoreArchive 12 | 13 | #pragma mark - 偏好类信息存储 14 | //保存普通对象 15 | +(void)setStr:(NSString *)str key:(NSString *)key{ 16 | 17 | //获取preference 18 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 19 | 20 | //保存 21 | [defaults setObject:str forKey:key]; 22 | 23 | //立即同步 24 | [defaults synchronize]; 25 | 26 | } 27 | 28 | //读取 29 | +(NSString *)strForKey:(NSString *)key{ 30 | 31 | //获取preference 32 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 33 | 34 | //读取 35 | NSString *str=(NSString *)[defaults objectForKey:key]; 36 | 37 | return str; 38 | 39 | } 40 | 41 | //删除 42 | +(void)removeStrForKey:(NSString *)key{ 43 | 44 | [self setStr:nil key:key]; 45 | 46 | } 47 | 48 | //保存int 49 | +(void)setInt:(NSInteger)i key:(NSString *)key{ 50 | //获取preference 51 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 52 | 53 | //保存 54 | [defaults setInteger:i forKey:key]; 55 | 56 | //立即同步 57 | [defaults synchronize]; 58 | 59 | } 60 | 61 | //读取 62 | +(NSInteger)intForKey:(NSString *)key{ 63 | //获取preference 64 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 65 | 66 | //读取 67 | NSInteger i=[defaults integerForKey:key]; 68 | 69 | return i; 70 | } 71 | 72 | //保存float 73 | +(void)setFloat:(CGFloat)floatValue key:(NSString *)key{ 74 | 75 | //获取preference 76 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 77 | 78 | //保存 79 | [defaults setFloat:floatValue forKey:key]; 80 | 81 | //立即同步 82 | [defaults synchronize]; 83 | 84 | } 85 | //读取 86 | +(CGFloat)floatForKey:(NSString *)key{ 87 | //获取preference 88 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 89 | 90 | //读取 91 | CGFloat floatValue=[defaults floatForKey:key]; 92 | 93 | return floatValue; 94 | } 95 | 96 | 97 | //保存bool 98 | +(void)setBool:(BOOL)boolValue key:(NSString *)key{ 99 | //获取preference 100 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 101 | 102 | //保存 103 | [defaults setBool:boolValue forKey:key]; 104 | 105 | //立即同步 106 | [defaults synchronize]; 107 | 108 | } 109 | //读取 110 | +(BOOL)boolForKey:(NSString *)key{ 111 | //获取preference 112 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 113 | 114 | //读取 115 | BOOL boolValue=[defaults boolForKey:key]; 116 | 117 | return boolValue; 118 | } 119 | 120 | 121 | 122 | 123 | #pragma mark - 文件归档 124 | //归档 125 | +(BOOL)archiveRootObject:(id)obj toFile:(NSString *)path{ 126 | return [NSKeyedArchiver archiveRootObject:obj toFile:path]; 127 | } 128 | //删除 129 | +(BOOL)removeRootObjectWithFile:(NSString *)path{ 130 | return [self archiveRootObject:nil toFile:path]; 131 | } 132 | //解档 133 | +(id)unarchiveObjectWithFile:(NSString *)path{ 134 | return [NSKeyedUnarchiver unarchiveObjectWithFile:path]; 135 | } 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | @end 145 | -------------------------------------------------------------------------------- /CoreLock/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /CoreLock.xcodeproj/xcuserdata/Charlin.xcuserdatad/xcschemes/CoreLock.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /CoreLock/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 29 | 38 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/View/CLLockItemView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockItemView.m 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/21. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import "CLLockItemView.h" 10 | #import "CoreLockConst.h" 11 | 12 | @interface CLLockItemView () 13 | 14 | /** 圆环rect */ 15 | @property (nonatomic,assign) CGRect calRect; 16 | 17 | /** 选中的rect */ 18 | @property (nonatomic,assign) CGRect selectedRect; 19 | 20 | /** 角度 */ 21 | @property (nonatomic,assign) CGFloat angle; 22 | 23 | @end 24 | 25 | 26 | @implementation CLLockItemView 27 | 28 | -(instancetype)initWithFrame:(CGRect)frame{ 29 | 30 | self = [super initWithFrame:frame]; 31 | 32 | if(self){ 33 | 34 | self.backgroundColor = [UIColor clearColor]; 35 | } 36 | 37 | return self; 38 | } 39 | 40 | 41 | 42 | -(void)drawRect:(CGRect)rect{ 43 | 44 | //获取上下文 45 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 46 | 47 | //上下文旋转 48 | [self transFormCtx:ctx rect:rect]; 49 | 50 | //上下文属性设置 51 | [self propertySetting:ctx]; 52 | 53 | //外环:普通 54 | [self circleNormal:ctx rect:rect]; 55 | 56 | //选中情况下,绘制背景色 57 | if(_selected){ 58 | 59 | //外环:选中 60 | [self circleSelected:ctx rect:rect]; 61 | 62 | //三角形:方向标识 63 | [self directFlag:ctx rect:rect]; 64 | } 65 | 66 | 67 | } 68 | 69 | 70 | /* 71 | * 上下文旋转 72 | */ 73 | -(void)transFormCtx:(CGContextRef)ctx rect:(CGRect)rect{ 74 | 75 | if(self.direct == 0) return; 76 | 77 | CGFloat translateXY = rect.size.width * .5f; 78 | 79 | //平移 80 | CGContextTranslateCTM(ctx, translateXY, translateXY); 81 | 82 | CGContextRotateCTM(ctx, self.angle); 83 | 84 | //再平移回来 85 | CGContextTranslateCTM(ctx, -translateXY, -translateXY); 86 | } 87 | 88 | 89 | 90 | /* 91 | * 三角形:方向标识 92 | */ 93 | -(void)directFlag:(CGContextRef)ctx rect:(CGRect)rect{ 94 | 95 | if(self.direct == 0) return; 96 | 97 | //新建路径:三角形 98 | CGMutablePathRef trianglePathM = CGPathCreateMutable(); 99 | 100 | CGFloat marginSelectedCirclev = 4.0f; 101 | CGFloat w =8.0f; 102 | CGFloat h =5.0f; 103 | CGFloat topX = rect.origin.x + rect.size.width * .5f; 104 | CGFloat topY = rect.origin.y +(rect.size.width *.5f - h - marginSelectedCirclev - self.selectedRect.size.height *.5f); 105 | 106 | CGPathMoveToPoint(trianglePathM, NULL, topX, topY); 107 | 108 | //添加左边点 109 | CGFloat leftPointX = topX - w *.5f; 110 | CGFloat leftPointY =topY + h; 111 | CGPathAddLineToPoint(trianglePathM, NULL, leftPointX, leftPointY); 112 | 113 | //右边的点 114 | CGFloat rightPointX = topX + w *.5f; 115 | CGPathAddLineToPoint(trianglePathM, NULL, rightPointX, leftPointY); 116 | 117 | //将路径添加到上下文中 118 | CGContextAddPath(ctx, trianglePathM); 119 | 120 | //绘制圆环 121 | CGContextFillPath(ctx); 122 | 123 | //释放路径 124 | CGPathRelease(trianglePathM); 125 | } 126 | 127 | 128 | 129 | 130 | /* 131 | * 上下文属性设置 132 | */ 133 | -(void)propertySetting:(CGContextRef)ctx{ 134 | 135 | //设置线宽 136 | CGContextSetLineWidth(ctx, CoreLockArcLineW); 137 | 138 | //设置颜色 139 | UIColor *color = nil; 140 | if(_selected){ 141 | 142 | color = CoreLockCircleLineSelectedColor; 143 | }else{ 144 | color = CoreLockCircleLineNormalColor; 145 | } 146 | [color set]; 147 | } 148 | 149 | 150 | 151 | /* 152 | * 外环:普通 153 | */ 154 | -(void)circleNormal:(CGContextRef)ctx rect:(CGRect)rect{ 155 | 156 | //新建路径:外环 157 | CGMutablePathRef loopPath = CGPathCreateMutable(); 158 | 159 | //添加一个圆环路径 160 | CGRect calRect = self.calRect; 161 | CGPathAddEllipseInRect(loopPath, NULL, calRect); 162 | 163 | //将路径添加到上下文中 164 | CGContextAddPath(ctx, loopPath); 165 | 166 | //绘制圆环 167 | CGContextStrokePath(ctx); 168 | 169 | //释放路径 170 | CGPathRelease(loopPath); 171 | } 172 | 173 | 174 | /* 175 | * 外环:选中 176 | */ 177 | -(void)circleSelected:(CGContextRef)ctx rect:(CGRect)rect{ 178 | 179 | //新建路径:外环 180 | CGMutablePathRef circlePath = CGPathCreateMutable(); 181 | 182 | //绘制一个圆形 183 | CGPathAddEllipseInRect(circlePath, NULL, self.selectedRect); 184 | 185 | [CoreLockCircleLineSelectedCircleColor set]; 186 | 187 | //将路径添加到上下文中 188 | CGContextAddPath(ctx, circlePath); 189 | 190 | //绘制圆环 191 | CGContextFillPath(ctx); 192 | 193 | //释放路径 194 | CGPathRelease(circlePath); 195 | } 196 | 197 | 198 | 199 | 200 | 201 | 202 | -(void)setSelected:(BOOL)selected{ 203 | 204 | _selected = selected; 205 | 206 | [self setNeedsDisplay]; 207 | } 208 | 209 | 210 | -(CGRect)calRect{ 211 | 212 | if(CGRectEqualToRect(_calRect, CGRectZero)){ 213 | 214 | CGFloat lineW =CoreLockArcLineW; 215 | 216 | CGFloat sizeWH = self.bounds.size.width - lineW; 217 | CGFloat originXY = lineW *.5f; 218 | 219 | //添加一个圆环路径 220 | _calRect = (CGRect){CGPointMake(originXY, originXY),CGSizeMake(sizeWH, sizeWH)}; 221 | 222 | } 223 | 224 | return _calRect; 225 | } 226 | 227 | 228 | 229 | -(CGRect)selectedRect{ 230 | 231 | if(CGRectEqualToRect(_selectedRect, CGRectZero)){ 232 | 233 | CGRect rect = self.bounds; 234 | 235 | CGFloat selectRectWH = rect.size.width * CoreLockArcWHR; 236 | 237 | CGFloat selectRectXY = rect.size.width * (1 - CoreLockArcWHR) *.5f; 238 | 239 | _selectedRect = CGRectMake(selectRectXY, selectRectXY, selectRectWH, selectRectWH); 240 | } 241 | 242 | return _selectedRect; 243 | } 244 | 245 | -(void)setDirect:(LockItemViewDirect)direct{ 246 | 247 | _direct = direct; 248 | 249 | self.angle = M_PI_4 * (direct -1); 250 | 251 | [self setNeedsDisplay]; 252 | } 253 | 254 | 255 | @end 256 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/CLLockVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockVC.m 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/21. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import "CLLockVC.h" 10 | #import "CoreLockConst.h" 11 | #import "CoreArchive.h" 12 | #import "CLLockLabel.h" 13 | #import "CLLockNavVC.h" 14 | #import "CLLockView.h" 15 | 16 | 17 | 18 | @interface CLLockVC () 19 | 20 | /** 操作成功:密码设置成功、密码验证成功 */ 21 | @property (nonatomic,copy) void (^successBlock)(CLLockVC *lockVC,NSString *pwd); 22 | 23 | @property (nonatomic,copy) void (^forgetPwdBlock)(); 24 | 25 | @property (weak, nonatomic) IBOutlet CLLockLabel *label; 26 | 27 | @property (nonatomic,copy) NSString *msg; 28 | 29 | @property (weak, nonatomic) IBOutlet CLLockView *lockView; 30 | 31 | @property (nonatomic,weak) UIViewController *vc; 32 | 33 | @property (nonatomic,strong) UIBarButtonItem *resetItem; 34 | 35 | 36 | @property (nonatomic,copy) NSString *modifyCurrentTitle; 37 | 38 | 39 | @property (weak, nonatomic) IBOutlet UIView *actionView; 40 | 41 | @property (weak, nonatomic) IBOutlet UIButton *modifyBtn; 42 | 43 | 44 | 45 | /** 直接进入修改页面的 */ 46 | @property (nonatomic,assign) BOOL isDirectModify; 47 | 48 | 49 | 50 | @end 51 | 52 | @implementation CLLockVC 53 | 54 | - (void)viewDidLoad { 55 | 56 | [super viewDidLoad]; 57 | 58 | //控制器准备 59 | [self vcPrepare]; 60 | 61 | //数据传输 62 | [self dataTransfer]; 63 | 64 | //事件 65 | [self event]; 66 | } 67 | 68 | 69 | /* 70 | * 事件 71 | */ 72 | -(void)event{ 73 | 74 | 75 | /* 76 | * 设置密码 77 | */ 78 | 79 | /** 开始输入:第一次 */ 80 | self.lockView.setPWBeginBlock = ^(){ 81 | 82 | [self.label showNormalMsg:CoreLockPWDTitleFirst]; 83 | }; 84 | 85 | /** 开始输入:确认 */ 86 | self.lockView.setPWConfirmlock = ^(){ 87 | 88 | [self.label showNormalMsg:CoreLockPWDTitleConfirm]; 89 | }; 90 | 91 | 92 | /** 密码长度不够 */ 93 | self.lockView.setPWSErrorLengthTooShortBlock = ^(NSUInteger currentCount){ 94 | 95 | [self.label showWarnMsg:[NSString stringWithFormat:@"请连接至少%@个点",@(CoreLockMinItemCount)]]; 96 | }; 97 | 98 | /** 两次密码不一致 */ 99 | self.lockView.setPWSErrorTwiceDiffBlock = ^(NSString *pwd1,NSString *pwdNow){ 100 | 101 | [self.label showWarnMsg:CoreLockPWDDiffTitle]; 102 | 103 | self.navigationItem.rightBarButtonItem = self.resetItem; 104 | }; 105 | 106 | /** 第一次输入密码:正确 */ 107 | self.lockView.setPWFirstRightBlock = ^(){ 108 | 109 | [self.label showNormalMsg:CoreLockPWDTitleConfirm]; 110 | }; 111 | 112 | /** 再次输入密码一致 */ 113 | self.lockView.setPWTwiceSameBlock = ^(NSString *pwd){ 114 | 115 | [self.label showNormalMsg:CoreLockPWSuccessTitle]; 116 | 117 | //存储密码 118 | [CoreArchive setStr:pwd key:CoreLockPWDKey]; 119 | 120 | //禁用交互 121 | self.view.userInteractionEnabled = NO; 122 | 123 | if(_successBlock != nil) _successBlock(self,pwd); 124 | 125 | if(CoreLockTypeModifyPwd == _type){ 126 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(.5f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 127 | [self.navigationController popViewControllerAnimated:YES]; 128 | }); 129 | } 130 | }; 131 | 132 | 133 | 134 | /* 135 | * 验证密码 136 | */ 137 | 138 | /** 开始 */ 139 | self.lockView.verifyPWBeginBlock = ^(){ 140 | 141 | [self.label showNormalMsg:CoreLockVerifyNormalTitle]; 142 | }; 143 | 144 | /** 验证 */ 145 | self.lockView.verifyPwdBlock = ^(NSString *pwd){ 146 | 147 | //取出本地密码 148 | NSString *pwdLocal = [CoreArchive strForKey:CoreLockPWDKey]; 149 | 150 | BOOL res = [pwdLocal isEqualToString:pwd]; 151 | 152 | if(res){//密码一致 153 | 154 | [self.label showNormalMsg:CoreLockVerifySuccesslTitle]; 155 | 156 | if(CoreLockTypeVeryfiPwd == _type){ 157 | 158 | //禁用交互 159 | self.view.userInteractionEnabled = NO; 160 | 161 | }else if (CoreLockTypeModifyPwd == _type){//修改密码 162 | 163 | [self.label showNormalMsg:CoreLockPWDTitleFirst]; 164 | 165 | self.modifyCurrentTitle = CoreLockPWDTitleFirst; 166 | } 167 | 168 | if(CoreLockTypeVeryfiPwd == _type) { 169 | if(_successBlock != nil) _successBlock(self,pwd); 170 | } 171 | 172 | }else{//密码不一致 173 | 174 | [self.label showWarnMsg:CoreLockVerifyErrorPwdTitle]; 175 | 176 | } 177 | 178 | return res; 179 | }; 180 | 181 | 182 | 183 | /* 184 | * 修改 185 | */ 186 | 187 | /** 开始 */ 188 | self.lockView.modifyPwdBlock =^(){ 189 | 190 | [self.label showNormalMsg:self.modifyCurrentTitle]; 191 | }; 192 | 193 | 194 | } 195 | 196 | 197 | 198 | 199 | 200 | 201 | /* 202 | * 数据传输 203 | */ 204 | -(void)dataTransfer{ 205 | 206 | [self.label showNormalMsg:self.msg]; 207 | 208 | //传递类型 209 | self.lockView.type = self.type; 210 | } 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | /* 219 | * 控制器准备 220 | */ 221 | -(void)vcPrepare{ 222 | 223 | //设置背景色 224 | self.view.backgroundColor = CoreLockViewBgColor; 225 | 226 | //初始情况隐藏 227 | self.navigationItem.rightBarButtonItem = nil; 228 | 229 | self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil]; 230 | 231 | //默认标题 232 | self.modifyCurrentTitle = CoreLockModifyNormalTitle; 233 | 234 | if(CoreLockTypeModifyPwd == _type) { 235 | 236 | _actionView.hidden = YES; 237 | 238 | [_actionView removeFromSuperview]; 239 | 240 | if(_isDirectModify) return; 241 | 242 | self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"关闭" style:UIBarButtonItemStylePlain target:self action:@selector(dismiss)]; 243 | } 244 | 245 | if(![self.class hasPwd]){ 246 | [_modifyBtn removeFromSuperview]; 247 | } 248 | } 249 | 250 | -(void)dismiss{ 251 | [self dismiss:0]; 252 | } 253 | 254 | 255 | 256 | /* 257 | * 密码重设 258 | */ 259 | -(void)setPwdReset{ 260 | 261 | [self.label showNormalMsg:CoreLockPWDTitleFirst]; 262 | 263 | //隐藏 264 | self.navigationItem.rightBarButtonItem = nil; 265 | 266 | //通知视图重设 267 | [self.lockView resetPwd]; 268 | } 269 | 270 | 271 | /* 272 | * 忘记密码 273 | */ 274 | -(void)forgetPwd{ 275 | 276 | } 277 | 278 | 279 | 280 | /* 281 | * 修改密码 282 | */ 283 | -(void)modiftyPwd{ 284 | 285 | } 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | /* 295 | * 是否有本地密码缓存?即用户是否设置过初始密码? 296 | */ 297 | +(BOOL)hasPwd{ 298 | 299 | NSString *pwd = [CoreArchive strForKey:CoreLockPWDKey]; 300 | 301 | return pwd !=nil; 302 | } 303 | 304 | 305 | 306 | 307 | /* 308 | * 展示设置密码控制器 309 | */ 310 | +(instancetype)showSettingLockVCInVC:(UIViewController *)vc successBlock:(void(^)(CLLockVC *lockVC,NSString *pwd))successBlock{ 311 | 312 | CLLockVC *lockVC = [self lockVC:vc]; 313 | 314 | lockVC.title = @"设置密码"; 315 | 316 | //设置类型 317 | lockVC.type = CoreLockTypeSetPwd; 318 | 319 | //保存block 320 | lockVC.successBlock = successBlock; 321 | 322 | return lockVC; 323 | } 324 | 325 | 326 | 327 | 328 | /* 329 | * 展示验证密码输入框 330 | */ 331 | +(instancetype)showVerifyLockVCInVC:(UIViewController *)vc forgetPwdBlock:(void(^)())forgetPwdBlock successBlock:(void(^)(CLLockVC *lockVC, NSString *pwd))successBlock{ 332 | 333 | 334 | CLLockVC *lockVC = [self lockVC:vc]; 335 | 336 | lockVC.title = @"手势解锁"; 337 | 338 | //设置类型 339 | lockVC.type = CoreLockTypeVeryfiPwd; 340 | 341 | //保存block 342 | lockVC.successBlock = successBlock; 343 | lockVC.forgetPwdBlock = forgetPwdBlock; 344 | 345 | return lockVC; 346 | } 347 | 348 | 349 | 350 | 351 | /* 352 | * 展示验证密码输入框 353 | */ 354 | +(instancetype)showModifyLockVCInVC:(UIViewController *)vc successBlock:(void(^)(CLLockVC *lockVC, NSString *pwd))successBlock{ 355 | 356 | CLLockVC *lockVC = [self lockVC:vc]; 357 | 358 | lockVC.title = @"修改密码"; 359 | 360 | //设置类型 361 | lockVC.type = CoreLockTypeModifyPwd; 362 | 363 | //记录 364 | lockVC.successBlock = successBlock; 365 | 366 | return lockVC; 367 | } 368 | 369 | 370 | 371 | 372 | 373 | +(instancetype)lockVC:(UIViewController *)vc{ 374 | 375 | CLLockVC *lockVC = [[CLLockVC alloc] init]; 376 | 377 | lockVC.vc = vc; 378 | 379 | CLLockNavVC *navVC = [[CLLockNavVC alloc] initWithRootViewController:lockVC]; 380 | 381 | [vc presentViewController:navVC animated:YES completion:nil]; 382 | 383 | 384 | return lockVC; 385 | } 386 | 387 | 388 | 389 | -(void)setType:(CoreLockType)type{ 390 | 391 | _type = type; 392 | 393 | //根据type自动调整label文字 394 | [self labelWithType]; 395 | } 396 | 397 | 398 | 399 | /* 400 | * 根据type自动调整label文字 401 | */ 402 | -(void)labelWithType{ 403 | 404 | if(CoreLockTypeSetPwd == _type){//设置密码 405 | 406 | self.msg = CoreLockPWDTitleFirst; 407 | 408 | }else if (CoreLockTypeVeryfiPwd == _type){//验证密码 409 | 410 | self.msg = CoreLockVerifyNormalTitle; 411 | 412 | }else if (CoreLockTypeModifyPwd == _type){//修改密码 413 | 414 | self.msg = CoreLockModifyNormalTitle; 415 | } 416 | } 417 | 418 | 419 | 420 | 421 | /* 422 | * 消失 423 | */ 424 | -(void)dismiss:(NSTimeInterval)interval{ 425 | 426 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(interval * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 427 | [self dismissViewControllerAnimated:YES completion:nil]; 428 | }); 429 | } 430 | 431 | 432 | /* 433 | * 重置 434 | */ 435 | -(UIBarButtonItem *)resetItem{ 436 | 437 | if(_resetItem == nil){ 438 | //添加右按钮 439 | _resetItem= [[UIBarButtonItem alloc] initWithTitle:@"重设" style:UIBarButtonItemStylePlain target:self action:@selector(setPwdReset)]; 440 | } 441 | 442 | return _resetItem; 443 | } 444 | 445 | 446 | - (IBAction)forgetPwdAction:(id)sender { 447 | 448 | [self dismiss:0]; 449 | if(_forgetPwdBlock != nil) _forgetPwdBlock(); 450 | } 451 | 452 | 453 | - (IBAction)modifyPwdAction:(id)sender { 454 | 455 | CLLockVC *lockVC = [[CLLockVC alloc] init]; 456 | 457 | lockVC.title = @"修改密码"; 458 | 459 | lockVC.isDirectModify = YES; 460 | 461 | //设置类型 462 | lockVC.type = CoreLockTypeModifyPwd; 463 | 464 | [self.navigationController pushViewController:lockVC animated:YES]; 465 | } 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | @end 479 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/Lib/View/CLLockView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CLLockView.m 3 | // CoreLock 4 | // 5 | // Created by 成林 on 15/4/21. 6 | // Copyright (c) 2015年 冯成林. All rights reserved. 7 | // 8 | 9 | #import "CLLockView.h" 10 | #import "CLLockItemView.h" 11 | #import "CoreLockConst.h" 12 | 13 | 14 | const CGFloat marginValue = 36.0f; 15 | 16 | 17 | @interface CLLockView () 18 | 19 | /** 装itemView的可变数组*/ 20 | @property (nonatomic,strong) NSMutableArray *itemViewsM; 21 | 22 | 23 | /** 临时密码记录器 */ 24 | @property (nonatomic,copy) NSMutableString *pwdM; 25 | 26 | 27 | /** 设置密码:第一次设置的正确的密码 */ 28 | @property (nonatomic,copy) NSString *firstRightPWD; 29 | 30 | 31 | /** 修改密码过程中的验证旧密码正确 */ 32 | @property (nonatomic,assign) BOOL modify_VeriryOldRight; 33 | 34 | 35 | 36 | 37 | @end 38 | 39 | 40 | 41 | @implementation CLLockView 42 | 43 | 44 | -(id)initWithCoder:(NSCoder *)aDecoder{ 45 | 46 | self=[super initWithCoder:aDecoder]; 47 | 48 | if(self){ 49 | 50 | //解锁视图准备 51 | [self lockViewPrepare]; 52 | } 53 | 54 | return self; 55 | } 56 | 57 | 58 | 59 | -(instancetype)initWithFrame:(CGRect)frame{ 60 | 61 | self = [super initWithFrame:frame]; 62 | 63 | if(self){ 64 | 65 | //解锁视图准备 66 | [self lockViewPrepare]; 67 | } 68 | 69 | return self; 70 | } 71 | 72 | 73 | /* 74 | * 绘制线条 75 | */ 76 | -(void)drawRect:(CGRect)rect{ 77 | 78 | //数组为空直接返回 79 | if(_itemViewsM == nil || _itemViewsM.count == 0) return; 80 | 81 | //获取上下文 82 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 83 | 84 | //添加路径 85 | CGContextAddRect(ctx, rect); 86 | 87 | //添加圆形路径 88 | //遍历所有的itemView 89 | [_itemViewsM enumerateObjectsUsingBlock:^(CLLockItemView *itemView, NSUInteger idx, BOOL *stop) { 90 | 91 | CGContextAddEllipseInRect(ctx, itemView.frame); 92 | }]; 93 | 94 | //剪裁 95 | CGContextEOClip(ctx); 96 | 97 | //新建路径:管理线条 98 | CGMutablePathRef pathM = CGPathCreateMutable(); 99 | 100 | //设置上下文属性 101 | //1.设置线条颜色 102 | [CoreLockLockLineColor set]; 103 | 104 | //线条转角样式 105 | CGContextSetLineCap(ctx, kCGLineCapRound); 106 | CGContextSetLineJoin(ctx, kCGLineJoinRound); 107 | 108 | //设置线宽 109 | CGContextSetLineWidth(ctx, 1.0f); 110 | 111 | //遍历所有的itemView 112 | [_itemViewsM enumerateObjectsUsingBlock:^(CLLockItemView *itemView, NSUInteger idx, BOOL *stop) { 113 | 114 | CGPoint directPoint = itemView.center; 115 | 116 | if(idx == 0){//第一个 117 | 118 | //添加起点 119 | CGPathMoveToPoint(pathM, NULL, directPoint.x, directPoint.y); 120 | 121 | }else{//其他 122 | 123 | //添加路径线条 124 | CGPathAddLineToPoint(pathM, NULL, directPoint.x, directPoint.y); 125 | } 126 | }]; 127 | 128 | //将路径添加到上下文 129 | CGContextAddPath(ctx, pathM); 130 | 131 | //渲染路径 132 | CGContextStrokePath(ctx); 133 | 134 | //释放路径 135 | CGPathRelease(pathM); 136 | } 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | /* 147 | * 解锁视图准备 148 | */ 149 | -(void)lockViewPrepare{ 150 | 151 | for (NSUInteger i=0; i<9; i++) { 152 | 153 | CLLockItemView *itemView = [[CLLockItemView alloc] init]; 154 | 155 | [self addSubview:itemView]; 156 | } 157 | } 158 | 159 | 160 | -(void)layoutSubviews{ 161 | 162 | [super layoutSubviews]; 163 | 164 | CGFloat itemViewWH = (self.frame.size.width - 4 * marginValue) /3.0f; 165 | 166 | [self.subviews enumerateObjectsUsingBlock:^(UIView *subview, NSUInteger idx, BOOL *stop) { 167 | 168 | NSUInteger row = idx % 3; 169 | 170 | NSUInteger col = idx / 3; 171 | 172 | CGFloat x = marginValue * (row +1) + row * itemViewWH; 173 | 174 | CGFloat y =marginValue * (col +1) + col * itemViewWH; 175 | 176 | CGRect frame = CGRectMake(x, y, itemViewWH, itemViewWH); 177 | 178 | //设置tag 179 | subview.tag = idx; 180 | 181 | subview.frame = frame; 182 | }]; 183 | 184 | } 185 | 186 | 187 | 188 | 189 | 190 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ 191 | 192 | //解锁处理 193 | [self lockHandle:touches]; 194 | 195 | 196 | if(CoreLockTypeSetPwd == _type){ // 设置密码 197 | //开始 198 | if(self.firstRightPWD == nil){//第一次输入 199 | 200 | if(_setPWBeginBlock != nil) _setPWBeginBlock(); 201 | 202 | }else{//确认 203 | 204 | if(_setPWConfirmlock != nil) _setPWConfirmlock(); 205 | } 206 | }else if(CoreLockTypeVeryfiPwd == _type){//验证密码 207 | 208 | //开始 209 | if(_verifyPWBeginBlock != nil) _verifyPWBeginBlock(); 210 | 211 | }else if (CoreLockTypeModifyPwd == _type){ 212 | 213 | //开始 214 | if(_modifyPwdBlock != nil) _modifyPwdBlock(); 215 | } 216 | } 217 | 218 | 219 | -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ 220 | 221 | //解锁处理 222 | [self lockHandle:touches]; 223 | } 224 | 225 | 226 | 227 | -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ 228 | 229 | //手势结束 230 | [self gestureEnd]; 231 | } 232 | 233 | 234 | -(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event{ 235 | 236 | //手势结束 237 | [self gestureEnd]; 238 | } 239 | 240 | 241 | /* 242 | * 手势结束 243 | */ 244 | -(void)gestureEnd{ 245 | 246 | 247 | //设置密码检查 248 | if(self.pwdM.length != 0){ 249 | [self setpwdCheck]; 250 | } 251 | 252 | 253 | for (CLLockItemView *itemView in self.itemViewsM) { 254 | 255 | itemView.selected = NO; 256 | 257 | //清空方向 258 | itemView.direct = 0; 259 | } 260 | 261 | //清空数组所有对象 262 | [self.itemViewsM removeAllObjects]; 263 | 264 | //再绘制 265 | [self setNeedsDisplay]; 266 | 267 | //清空密码 268 | self.pwdM = nil; 269 | 270 | } 271 | 272 | 273 | 274 | /* 275 | * 设置密码检查 276 | */ 277 | -(void)setpwdCheck{ 278 | 279 | NSUInteger count = self.itemViewsM.count; 280 | 281 | if(count < CoreLockMinItemCount){ 282 | if(_setPWSErrorLengthTooShortBlock != nil) _setPWSErrorLengthTooShortBlock(count); 283 | return; 284 | } 285 | 286 | if(CoreLockTypeSetPwd == _type){//设置密码 287 | 288 | //设置密码 289 | [self setpwd]; 290 | 291 | }else if(CoreLockTypeVeryfiPwd == _type){//验证密码 292 | 293 | if(_verifyPwdBlock != nil) _verifyPwdBlock(self.pwdM); 294 | 295 | }else if (CoreLockTypeModifyPwd == _type){//修改密码 296 | 297 | if(!_modify_VeriryOldRight){ 298 | 299 | if(_verifyPwdBlock != nil){ 300 | _modify_VeriryOldRight = _verifyPwdBlock(self.pwdM); 301 | } 302 | 303 | }else{ 304 | 305 | //设置密码 306 | [self setpwd]; 307 | } 308 | } 309 | 310 | } 311 | 312 | 313 | 314 | 315 | /* 316 | * 设置密码 317 | */ 318 | -(void)setpwd{ 319 | 320 | //密码合法 321 | if(self.firstRightPWD == nil){// 第一次设置密码 322 | self.firstRightPWD = self.pwdM; 323 | if(_setPWFirstRightBlock != nil) _setPWFirstRightBlock(); 324 | }else{ 325 | 326 | if(![self.firstRightPWD isEqualToString:self.pwdM]){//两次密码不一致 327 | 328 | if(_setPWSErrorTwiceDiffBlock != nil) _setPWSErrorTwiceDiffBlock(self.firstRightPWD,self.pwdM); 329 | return; 330 | 331 | }else{//再次密码输入一致 332 | 333 | if(_setPWTwiceSameBlock != nil) _setPWTwiceSameBlock(self.firstRightPWD); 334 | } 335 | } 336 | 337 | } 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | /* 350 | * 解锁处理 351 | */ 352 | -(void)lockHandle:(NSSet *)touches{ 353 | 354 | //取出触摸点 355 | UITouch *touch = [touches anyObject]; 356 | 357 | CGPoint loc = [touch locationInView:self]; 358 | 359 | CLLockItemView *itemView = [self itemViewWithTouchLocation:loc]; 360 | 361 | //如果为空,返回 362 | if(itemView ==nil) return; 363 | 364 | //如果已经存在,返回 365 | if([self.itemViewsM containsObject:itemView]) return; 366 | 367 | //添加 368 | [self.itemViewsM addObject:itemView]; 369 | 370 | //记录密码 371 | [self.pwdM appendFormat:@"%@",@(itemView.tag)]; 372 | 373 | 374 | //计算方向:每添加一次itemView就计算一次 375 | [self calDirect]; 376 | 377 | //item处理 378 | [self itemHandel:itemView]; 379 | } 380 | 381 | 382 | 383 | /* 384 | * 计算方向:每添加一次itemView就计算一次 385 | */ 386 | -(void)calDirect{ 387 | 388 | NSUInteger count = _itemViewsM.count; 389 | 390 | if(_itemViewsM==nil || count<=1) return; 391 | 392 | //取出最后一个对象 393 | CLLockItemView *last_1_ItemView = _itemViewsM.lastObject; 394 | 395 | //倒数第二个 396 | CLLockItemView *last_2_ItemView =_itemViewsM[count -2]; 397 | 398 | //计算倒数第二个的位置 399 | CGFloat last_1_x = last_1_ItemView.frame.origin.x; 400 | CGFloat last_1_y = last_1_ItemView.frame.origin.y; 401 | CGFloat last_2_x = last_2_ItemView.frame.origin.x; 402 | CGFloat last_2_y = last_2_ItemView.frame.origin.y; 403 | 404 | //倒数第一个itemView相对倒数第二个itemView来说 405 | //正上 406 | if(last_2_x == last_1_x && last_2_y > last_1_y) { 407 | last_2_ItemView.direct = LockItemViewDirecTop; 408 | } 409 | 410 | //正左 411 | if(last_2_y == last_1_y && last_2_x > last_1_x) { 412 | last_2_ItemView.direct = LockItemViewDirecLeft; 413 | } 414 | 415 | //正下 416 | if(last_2_x == last_1_x && last_2_y < last_1_y) { 417 | last_2_ItemView.direct = LockItemViewDirecBottom; 418 | } 419 | 420 | //正右 421 | if(last_2_y == last_1_y && last_2_x < last_1_x) { 422 | last_2_ItemView.direct = LockItemViewDirecRight; 423 | } 424 | 425 | //左上 426 | if(last_2_x > last_1_x && last_2_y > last_1_y) { 427 | last_2_ItemView.direct = LockItemViewDirecLeftTop; 428 | } 429 | 430 | //右上 431 | if(last_2_x < last_1_x && last_2_y > last_1_y) { 432 | last_2_ItemView.direct = LockItemViewDirecRightTop; 433 | } 434 | 435 | //左下 436 | if(last_2_x > last_1_x && last_2_y < last_1_y) { 437 | last_2_ItemView.direct = LockItemViewDirecLeftBottom; 438 | } 439 | 440 | //右下 441 | if(last_2_x < last_1_x && last_2_y < last_1_y) { 442 | last_2_ItemView.direct = LockItemViewDiretRightBottom; 443 | } 444 | 445 | } 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | /* 455 | * item处理 456 | */ 457 | -(void)itemHandel:(CLLockItemView *)itemView{ 458 | 459 | //选中 460 | itemView.selected = YES; 461 | 462 | //绘制 463 | [self setNeedsDisplay]; 464 | } 465 | 466 | 467 | 468 | -(CLLockItemView *)itemViewWithTouchLocation:(CGPoint)loc{ 469 | 470 | CLLockItemView *itemView = nil; 471 | 472 | for (CLLockItemView *itemViewSub in self.subviews) { 473 | 474 | if(!CGRectContainsPoint(itemViewSub.frame, loc)) continue; 475 | itemView = itemViewSub; 476 | break; 477 | } 478 | 479 | return itemView; 480 | } 481 | 482 | 483 | 484 | 485 | -(NSMutableArray *)itemViewsM{ 486 | 487 | if(_itemViewsM == nil){ 488 | 489 | _itemViewsM = [NSMutableArray array]; 490 | } 491 | 492 | return _itemViewsM; 493 | } 494 | 495 | 496 | -(NSMutableString *)pwdM{ 497 | 498 | if(_pwdM == nil){ 499 | 500 | _pwdM = [NSMutableString string]; 501 | } 502 | 503 | return _pwdM; 504 | } 505 | 506 | 507 | /* 508 | * 重设密码 509 | */ 510 | -(void)resetPwd{ 511 | 512 | //清空第一次密码即可 513 | self.firstRightPWD = nil; 514 | } 515 | 516 | @end 517 | -------------------------------------------------------------------------------- /CoreLock/CoreLock/CLLockVC.xib: -------------------------------------------------------------------------------- 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 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 120 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | -------------------------------------------------------------------------------- /CoreLock.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 89372D5F1AEE84F200DE430A /* NSString+File.m in Sources */ = {isa = PBXBuildFile; fileRef = 89372D5C1AEE84F200DE430A /* NSString+File.m */; }; 11 | 89372D601AEE84F200DE430A /* CoreArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = 89372D5E1AEE84F200DE430A /* CoreArchive.m */; }; 12 | 8939E5EC1AEF02EE006B9ABA /* CLLockVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 8939E5DD1AEF02EE006B9ABA /* CLLockVC.m */; }; 13 | 8939E5ED1AEF02EE006B9ABA /* CLLockVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8939E5DE1AEF02EE006B9ABA /* CLLockVC.xib */; }; 14 | 8939E5EE1AEF02EE006B9ABA /* CoreLockConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 8939E5E21AEF02EE006B9ABA /* CoreLockConst.m */; }; 15 | 8939E5EF1AEF02EE006B9ABA /* CLLockInfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8939E5E51AEF02EE006B9ABA /* CLLockInfoView.m */; }; 16 | 8939E5F01AEF02EE006B9ABA /* CLLockItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8939E5E71AEF02EE006B9ABA /* CLLockItemView.m */; }; 17 | 8939E5F11AEF02EE006B9ABA /* CLLockLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8939E5E91AEF02EE006B9ABA /* CLLockLabel.m */; }; 18 | 8939E5F21AEF02EE006B9ABA /* CLLockView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8939E5EB1AEF02EE006B9ABA /* CLLockView.m */; }; 19 | 8939E5F61AEF0664006B9ABA /* CLLockNavVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 8939E5F51AEF0664006B9ABA /* CLLockNavVC.m */; }; 20 | 893F1FF21AE68CF1009D6A35 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 893F1FF11AE68CF1009D6A35 /* main.m */; }; 21 | 893F1FF51AE68CF1009D6A35 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 893F1FF41AE68CF1009D6A35 /* AppDelegate.m */; }; 22 | 893F1FF81AE68CF1009D6A35 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 893F1FF71AE68CF1009D6A35 /* ViewController.m */; }; 23 | 893F1FFB1AE68CF1009D6A35 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 893F1FF91AE68CF1009D6A35 /* Main.storyboard */; }; 24 | 893F1FFD1AE68CF1009D6A35 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 893F1FFC1AE68CF1009D6A35 /* Images.xcassets */; }; 25 | 893F20001AE68CF1009D6A35 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 893F1FFE1AE68CF1009D6A35 /* LaunchScreen.xib */; }; 26 | 893F200C1AE68CF1009D6A35 /* CoreLockTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 893F200B1AE68CF1009D6A35 /* CoreLockTests.m */; }; 27 | 8952833F1AF71B4500ACED06 /* core.gif in Resources */ = {isa = PBXBuildFile; fileRef = 8952833E1AF71B4500ACED06 /* core.gif */; }; 28 | 8971F9011AEF581D009BFA27 /* CALayer+Anim.m in Sources */ = {isa = PBXBuildFile; fileRef = 8971F9001AEF581D009BFA27 /* CALayer+Anim.m */; }; 29 | 8971F9451AEF5D77009BFA27 /* CLLockMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8971F9441AEF5D77009BFA27 /* CLLockMainView.m */; }; 30 | 8971F9471AEF6678009BFA27 /* 1.png in Resources */ = {isa = PBXBuildFile; fileRef = 8971F9461AEF6678009BFA27 /* 1.png */; }; 31 | /* End PBXBuildFile section */ 32 | 33 | /* Begin PBXContainerItemProxy section */ 34 | 893F20061AE68CF1009D6A35 /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = 893F1FE41AE68CF1009D6A35 /* Project object */; 37 | proxyType = 1; 38 | remoteGlobalIDString = 893F1FEB1AE68CF1009D6A35; 39 | remoteInfo = CoreLock; 40 | }; 41 | /* End PBXContainerItemProxy section */ 42 | 43 | /* Begin PBXFileReference section */ 44 | 89372D5B1AEE84F200DE430A /* NSString+File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+File.h"; sourceTree = ""; }; 45 | 89372D5C1AEE84F200DE430A /* NSString+File.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+File.m"; sourceTree = ""; }; 46 | 89372D5D1AEE84F200DE430A /* CoreArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreArchive.h; sourceTree = ""; }; 47 | 89372D5E1AEE84F200DE430A /* CoreArchive.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreArchive.m; sourceTree = ""; }; 48 | 8939E5DC1AEF02EE006B9ABA /* CLLockVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLLockVC.h; sourceTree = ""; }; 49 | 8939E5DD1AEF02EE006B9ABA /* CLLockVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CLLockVC.m; sourceTree = ""; }; 50 | 8939E5DE1AEF02EE006B9ABA /* CLLockVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CLLockVC.xib; sourceTree = ""; }; 51 | 8939E5E11AEF02EE006B9ABA /* CoreLockConst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreLockConst.h; sourceTree = ""; }; 52 | 8939E5E21AEF02EE006B9ABA /* CoreLockConst.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreLockConst.m; sourceTree = ""; }; 53 | 8939E5E41AEF02EE006B9ABA /* CLLockInfoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLLockInfoView.h; sourceTree = ""; }; 54 | 8939E5E51AEF02EE006B9ABA /* CLLockInfoView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CLLockInfoView.m; sourceTree = ""; }; 55 | 8939E5E61AEF02EE006B9ABA /* CLLockItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLLockItemView.h; sourceTree = ""; }; 56 | 8939E5E71AEF02EE006B9ABA /* CLLockItemView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CLLockItemView.m; sourceTree = ""; }; 57 | 8939E5E81AEF02EE006B9ABA /* CLLockLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLLockLabel.h; sourceTree = ""; }; 58 | 8939E5E91AEF02EE006B9ABA /* CLLockLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CLLockLabel.m; sourceTree = ""; }; 59 | 8939E5EA1AEF02EE006B9ABA /* CLLockView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLLockView.h; sourceTree = ""; }; 60 | 8939E5EB1AEF02EE006B9ABA /* CLLockView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CLLockView.m; sourceTree = ""; }; 61 | 8939E5F41AEF0664006B9ABA /* CLLockNavVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLLockNavVC.h; sourceTree = ""; }; 62 | 8939E5F51AEF0664006B9ABA /* CLLockNavVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CLLockNavVC.m; sourceTree = ""; }; 63 | 893F1FEC1AE68CF1009D6A35 /* CoreLock.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CoreLock.app; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 893F1FF01AE68CF1009D6A35 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65 | 893F1FF11AE68CF1009D6A35 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 66 | 893F1FF31AE68CF1009D6A35 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 67 | 893F1FF41AE68CF1009D6A35 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 68 | 893F1FF61AE68CF1009D6A35 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 69 | 893F1FF71AE68CF1009D6A35 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 70 | 893F1FFA1AE68CF1009D6A35 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 71 | 893F1FFC1AE68CF1009D6A35 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 72 | 893F1FFF1AE68CF1009D6A35 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 73 | 893F20051AE68CF1009D6A35 /* CoreLockTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreLockTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 74 | 893F200A1AE68CF1009D6A35 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 75 | 893F200B1AE68CF1009D6A35 /* CoreLockTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CoreLockTests.m; sourceTree = ""; }; 76 | 8952833E1AF71B4500ACED06 /* core.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = core.gif; sourceTree = ""; }; 77 | 8971F8FF1AEF581D009BFA27 /* CALayer+Anim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CALayer+Anim.h"; sourceTree = ""; }; 78 | 8971F9001AEF581D009BFA27 /* CALayer+Anim.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CALayer+Anim.m"; sourceTree = ""; }; 79 | 8971F9221AEF5D0E009BFA27 /* CoreConst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreConst.h; sourceTree = ""; }; 80 | 8971F9431AEF5D77009BFA27 /* CLLockMainView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLLockMainView.h; sourceTree = ""; }; 81 | 8971F9441AEF5D77009BFA27 /* CLLockMainView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CLLockMainView.m; sourceTree = ""; }; 82 | 8971F9461AEF6678009BFA27 /* 1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 1.png; sourceTree = ""; }; 83 | /* End PBXFileReference section */ 84 | 85 | /* Begin PBXFrameworksBuildPhase section */ 86 | 893F1FE91AE68CF1009D6A35 /* Frameworks */ = { 87 | isa = PBXFrameworksBuildPhase; 88 | buildActionMask = 2147483647; 89 | files = ( 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | 893F20021AE68CF1009D6A35 /* Frameworks */ = { 94 | isa = PBXFrameworksBuildPhase; 95 | buildActionMask = 2147483647; 96 | files = ( 97 | ); 98 | runOnlyForDeploymentPostprocessing = 0; 99 | }; 100 | /* End PBXFrameworksBuildPhase section */ 101 | 102 | /* Begin PBXGroup section */ 103 | 89372D581AEE847600DE430A /* FrameWork */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 8971F9021AEF5D0D009BFA27 /* CoreExtend */, 107 | 89372D591AEE84F200DE430A /* CoreArchive */, 108 | ); 109 | path = FrameWork; 110 | sourceTree = ""; 111 | }; 112 | 89372D591AEE84F200DE430A /* CoreArchive */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 89372D5A1AEE84F200DE430A /* Category */, 116 | 89372D5D1AEE84F200DE430A /* CoreArchive.h */, 117 | 89372D5E1AEE84F200DE430A /* CoreArchive.m */, 118 | ); 119 | path = CoreArchive; 120 | sourceTree = ""; 121 | }; 122 | 89372D5A1AEE84F200DE430A /* Category */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 89372D5B1AEE84F200DE430A /* NSString+File.h */, 126 | 89372D5C1AEE84F200DE430A /* NSString+File.m */, 127 | ); 128 | path = Category; 129 | sourceTree = ""; 130 | }; 131 | 8939E5DB1AEF02EE006B9ABA /* CoreLock */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 8939E5DC1AEF02EE006B9ABA /* CLLockVC.h */, 135 | 8939E5DD1AEF02EE006B9ABA /* CLLockVC.m */, 136 | 8939E5DE1AEF02EE006B9ABA /* CLLockVC.xib */, 137 | 8939E5DF1AEF02EE006B9ABA /* Lib */, 138 | ); 139 | path = CoreLock; 140 | sourceTree = ""; 141 | }; 142 | 8939E5DF1AEF02EE006B9ABA /* Lib */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 8971F8FE1AEF580C009BFA27 /* Category */, 146 | 8939E5F31AEF063A006B9ABA /* Controller */, 147 | 8939E5E01AEF02EE006B9ABA /* Const */, 148 | 8939E5E31AEF02EE006B9ABA /* View */, 149 | ); 150 | path = Lib; 151 | sourceTree = ""; 152 | }; 153 | 8939E5E01AEF02EE006B9ABA /* Const */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | 8939E5E11AEF02EE006B9ABA /* CoreLockConst.h */, 157 | 8939E5E21AEF02EE006B9ABA /* CoreLockConst.m */, 158 | ); 159 | path = Const; 160 | sourceTree = ""; 161 | }; 162 | 8939E5E31AEF02EE006B9ABA /* View */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | 8939E5E41AEF02EE006B9ABA /* CLLockInfoView.h */, 166 | 8939E5E51AEF02EE006B9ABA /* CLLockInfoView.m */, 167 | 8939E5E61AEF02EE006B9ABA /* CLLockItemView.h */, 168 | 8939E5E71AEF02EE006B9ABA /* CLLockItemView.m */, 169 | 8939E5E81AEF02EE006B9ABA /* CLLockLabel.h */, 170 | 8939E5E91AEF02EE006B9ABA /* CLLockLabel.m */, 171 | 8939E5EA1AEF02EE006B9ABA /* CLLockView.h */, 172 | 8939E5EB1AEF02EE006B9ABA /* CLLockView.m */, 173 | 8971F9431AEF5D77009BFA27 /* CLLockMainView.h */, 174 | 8971F9441AEF5D77009BFA27 /* CLLockMainView.m */, 175 | ); 176 | path = View; 177 | sourceTree = ""; 178 | }; 179 | 8939E5F31AEF063A006B9ABA /* Controller */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | 8939E5F41AEF0664006B9ABA /* CLLockNavVC.h */, 183 | 8939E5F51AEF0664006B9ABA /* CLLockNavVC.m */, 184 | ); 185 | path = Controller; 186 | sourceTree = ""; 187 | }; 188 | 893F1FE31AE68CF1009D6A35 = { 189 | isa = PBXGroup; 190 | children = ( 191 | 893F1FEE1AE68CF1009D6A35 /* CoreLock */, 192 | 893F20081AE68CF1009D6A35 /* CoreLockTests */, 193 | 893F1FED1AE68CF1009D6A35 /* Products */, 194 | ); 195 | sourceTree = ""; 196 | }; 197 | 893F1FED1AE68CF1009D6A35 /* Products */ = { 198 | isa = PBXGroup; 199 | children = ( 200 | 893F1FEC1AE68CF1009D6A35 /* CoreLock.app */, 201 | 893F20051AE68CF1009D6A35 /* CoreLockTests.xctest */, 202 | ); 203 | name = Products; 204 | sourceTree = ""; 205 | }; 206 | 893F1FEE1AE68CF1009D6A35 /* CoreLock */ = { 207 | isa = PBXGroup; 208 | children = ( 209 | 8939E5DB1AEF02EE006B9ABA /* CoreLock */, 210 | 89372D581AEE847600DE430A /* FrameWork */, 211 | 893F1FF31AE68CF1009D6A35 /* AppDelegate.h */, 212 | 893F1FF41AE68CF1009D6A35 /* AppDelegate.m */, 213 | 893F1FF61AE68CF1009D6A35 /* ViewController.h */, 214 | 893F1FF71AE68CF1009D6A35 /* ViewController.m */, 215 | 893F1FF91AE68CF1009D6A35 /* Main.storyboard */, 216 | 893F1FFC1AE68CF1009D6A35 /* Images.xcassets */, 217 | 893F1FFE1AE68CF1009D6A35 /* LaunchScreen.xib */, 218 | 893F1FEF1AE68CF1009D6A35 /* Supporting Files */, 219 | ); 220 | path = CoreLock; 221 | sourceTree = ""; 222 | }; 223 | 893F1FEF1AE68CF1009D6A35 /* Supporting Files */ = { 224 | isa = PBXGroup; 225 | children = ( 226 | 8952833E1AF71B4500ACED06 /* core.gif */, 227 | 8971F9461AEF6678009BFA27 /* 1.png */, 228 | 893F1FF01AE68CF1009D6A35 /* Info.plist */, 229 | 893F1FF11AE68CF1009D6A35 /* main.m */, 230 | ); 231 | name = "Supporting Files"; 232 | sourceTree = ""; 233 | }; 234 | 893F20081AE68CF1009D6A35 /* CoreLockTests */ = { 235 | isa = PBXGroup; 236 | children = ( 237 | 893F200B1AE68CF1009D6A35 /* CoreLockTests.m */, 238 | 893F20091AE68CF1009D6A35 /* Supporting Files */, 239 | ); 240 | path = CoreLockTests; 241 | sourceTree = ""; 242 | }; 243 | 893F20091AE68CF1009D6A35 /* Supporting Files */ = { 244 | isa = PBXGroup; 245 | children = ( 246 | 893F200A1AE68CF1009D6A35 /* Info.plist */, 247 | ); 248 | name = "Supporting Files"; 249 | sourceTree = ""; 250 | }; 251 | 8971F8FE1AEF580C009BFA27 /* Category */ = { 252 | isa = PBXGroup; 253 | children = ( 254 | 8971F8FF1AEF581D009BFA27 /* CALayer+Anim.h */, 255 | 8971F9001AEF581D009BFA27 /* CALayer+Anim.m */, 256 | ); 257 | path = Category; 258 | sourceTree = ""; 259 | }; 260 | 8971F9021AEF5D0D009BFA27 /* CoreExtend */ = { 261 | isa = PBXGroup; 262 | children = ( 263 | 8971F9221AEF5D0E009BFA27 /* CoreConst.h */, 264 | ); 265 | path = CoreExtend; 266 | sourceTree = ""; 267 | }; 268 | /* End PBXGroup section */ 269 | 270 | /* Begin PBXNativeTarget section */ 271 | 893F1FEB1AE68CF1009D6A35 /* CoreLock */ = { 272 | isa = PBXNativeTarget; 273 | buildConfigurationList = 893F200F1AE68CF1009D6A35 /* Build configuration list for PBXNativeTarget "CoreLock" */; 274 | buildPhases = ( 275 | 893F1FE81AE68CF1009D6A35 /* Sources */, 276 | 893F1FE91AE68CF1009D6A35 /* Frameworks */, 277 | 893F1FEA1AE68CF1009D6A35 /* Resources */, 278 | ); 279 | buildRules = ( 280 | ); 281 | dependencies = ( 282 | ); 283 | name = CoreLock; 284 | productName = CoreLock; 285 | productReference = 893F1FEC1AE68CF1009D6A35 /* CoreLock.app */; 286 | productType = "com.apple.product-type.application"; 287 | }; 288 | 893F20041AE68CF1009D6A35 /* CoreLockTests */ = { 289 | isa = PBXNativeTarget; 290 | buildConfigurationList = 893F20121AE68CF1009D6A35 /* Build configuration list for PBXNativeTarget "CoreLockTests" */; 291 | buildPhases = ( 292 | 893F20011AE68CF1009D6A35 /* Sources */, 293 | 893F20021AE68CF1009D6A35 /* Frameworks */, 294 | 893F20031AE68CF1009D6A35 /* Resources */, 295 | ); 296 | buildRules = ( 297 | ); 298 | dependencies = ( 299 | 893F20071AE68CF1009D6A35 /* PBXTargetDependency */, 300 | ); 301 | name = CoreLockTests; 302 | productName = CoreLockTests; 303 | productReference = 893F20051AE68CF1009D6A35 /* CoreLockTests.xctest */; 304 | productType = "com.apple.product-type.bundle.unit-test"; 305 | }; 306 | /* End PBXNativeTarget section */ 307 | 308 | /* Begin PBXProject section */ 309 | 893F1FE41AE68CF1009D6A35 /* Project object */ = { 310 | isa = PBXProject; 311 | attributes = { 312 | LastUpgradeCheck = 0630; 313 | ORGANIZATIONNAME = "冯成林"; 314 | TargetAttributes = { 315 | 893F1FEB1AE68CF1009D6A35 = { 316 | CreatedOnToolsVersion = 6.3; 317 | }; 318 | 893F20041AE68CF1009D6A35 = { 319 | CreatedOnToolsVersion = 6.3; 320 | TestTargetID = 893F1FEB1AE68CF1009D6A35; 321 | }; 322 | }; 323 | }; 324 | buildConfigurationList = 893F1FE71AE68CF1009D6A35 /* Build configuration list for PBXProject "CoreLock" */; 325 | compatibilityVersion = "Xcode 3.2"; 326 | developmentRegion = English; 327 | hasScannedForEncodings = 0; 328 | knownRegions = ( 329 | en, 330 | Base, 331 | ); 332 | mainGroup = 893F1FE31AE68CF1009D6A35; 333 | productRefGroup = 893F1FED1AE68CF1009D6A35 /* Products */; 334 | projectDirPath = ""; 335 | projectRoot = ""; 336 | targets = ( 337 | 893F1FEB1AE68CF1009D6A35 /* CoreLock */, 338 | 893F20041AE68CF1009D6A35 /* CoreLockTests */, 339 | ); 340 | }; 341 | /* End PBXProject section */ 342 | 343 | /* Begin PBXResourcesBuildPhase section */ 344 | 893F1FEA1AE68CF1009D6A35 /* Resources */ = { 345 | isa = PBXResourcesBuildPhase; 346 | buildActionMask = 2147483647; 347 | files = ( 348 | 893F1FFB1AE68CF1009D6A35 /* Main.storyboard in Resources */, 349 | 8952833F1AF71B4500ACED06 /* core.gif in Resources */, 350 | 893F20001AE68CF1009D6A35 /* LaunchScreen.xib in Resources */, 351 | 8939E5ED1AEF02EE006B9ABA /* CLLockVC.xib in Resources */, 352 | 893F1FFD1AE68CF1009D6A35 /* Images.xcassets in Resources */, 353 | 8971F9471AEF6678009BFA27 /* 1.png in Resources */, 354 | ); 355 | runOnlyForDeploymentPostprocessing = 0; 356 | }; 357 | 893F20031AE68CF1009D6A35 /* Resources */ = { 358 | isa = PBXResourcesBuildPhase; 359 | buildActionMask = 2147483647; 360 | files = ( 361 | ); 362 | runOnlyForDeploymentPostprocessing = 0; 363 | }; 364 | /* End PBXResourcesBuildPhase section */ 365 | 366 | /* Begin PBXSourcesBuildPhase section */ 367 | 893F1FE81AE68CF1009D6A35 /* Sources */ = { 368 | isa = PBXSourcesBuildPhase; 369 | buildActionMask = 2147483647; 370 | files = ( 371 | 8939E5F11AEF02EE006B9ABA /* CLLockLabel.m in Sources */, 372 | 89372D5F1AEE84F200DE430A /* NSString+File.m in Sources */, 373 | 893F1FF81AE68CF1009D6A35 /* ViewController.m in Sources */, 374 | 8939E5EF1AEF02EE006B9ABA /* CLLockInfoView.m in Sources */, 375 | 893F1FF51AE68CF1009D6A35 /* AppDelegate.m in Sources */, 376 | 89372D601AEE84F200DE430A /* CoreArchive.m in Sources */, 377 | 8939E5F61AEF0664006B9ABA /* CLLockNavVC.m in Sources */, 378 | 8939E5EC1AEF02EE006B9ABA /* CLLockVC.m in Sources */, 379 | 8939E5F01AEF02EE006B9ABA /* CLLockItemView.m in Sources */, 380 | 893F1FF21AE68CF1009D6A35 /* main.m in Sources */, 381 | 8939E5F21AEF02EE006B9ABA /* CLLockView.m in Sources */, 382 | 8971F9451AEF5D77009BFA27 /* CLLockMainView.m in Sources */, 383 | 8971F9011AEF581D009BFA27 /* CALayer+Anim.m in Sources */, 384 | 8939E5EE1AEF02EE006B9ABA /* CoreLockConst.m in Sources */, 385 | ); 386 | runOnlyForDeploymentPostprocessing = 0; 387 | }; 388 | 893F20011AE68CF1009D6A35 /* Sources */ = { 389 | isa = PBXSourcesBuildPhase; 390 | buildActionMask = 2147483647; 391 | files = ( 392 | 893F200C1AE68CF1009D6A35 /* CoreLockTests.m in Sources */, 393 | ); 394 | runOnlyForDeploymentPostprocessing = 0; 395 | }; 396 | /* End PBXSourcesBuildPhase section */ 397 | 398 | /* Begin PBXTargetDependency section */ 399 | 893F20071AE68CF1009D6A35 /* PBXTargetDependency */ = { 400 | isa = PBXTargetDependency; 401 | target = 893F1FEB1AE68CF1009D6A35 /* CoreLock */; 402 | targetProxy = 893F20061AE68CF1009D6A35 /* PBXContainerItemProxy */; 403 | }; 404 | /* End PBXTargetDependency section */ 405 | 406 | /* Begin PBXVariantGroup section */ 407 | 893F1FF91AE68CF1009D6A35 /* Main.storyboard */ = { 408 | isa = PBXVariantGroup; 409 | children = ( 410 | 893F1FFA1AE68CF1009D6A35 /* Base */, 411 | ); 412 | name = Main.storyboard; 413 | sourceTree = ""; 414 | }; 415 | 893F1FFE1AE68CF1009D6A35 /* LaunchScreen.xib */ = { 416 | isa = PBXVariantGroup; 417 | children = ( 418 | 893F1FFF1AE68CF1009D6A35 /* Base */, 419 | ); 420 | name = LaunchScreen.xib; 421 | sourceTree = ""; 422 | }; 423 | /* End PBXVariantGroup section */ 424 | 425 | /* Begin XCBuildConfiguration section */ 426 | 893F200D1AE68CF1009D6A35 /* Debug */ = { 427 | isa = XCBuildConfiguration; 428 | buildSettings = { 429 | ALWAYS_SEARCH_USER_PATHS = NO; 430 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 431 | CLANG_CXX_LIBRARY = "libc++"; 432 | CLANG_ENABLE_MODULES = YES; 433 | CLANG_ENABLE_OBJC_ARC = YES; 434 | CLANG_WARN_BOOL_CONVERSION = YES; 435 | CLANG_WARN_CONSTANT_CONVERSION = YES; 436 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 437 | CLANG_WARN_EMPTY_BODY = YES; 438 | CLANG_WARN_ENUM_CONVERSION = YES; 439 | CLANG_WARN_INT_CONVERSION = YES; 440 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 441 | CLANG_WARN_UNREACHABLE_CODE = YES; 442 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 443 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 444 | COPY_PHASE_STRIP = NO; 445 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 446 | ENABLE_STRICT_OBJC_MSGSEND = YES; 447 | GCC_C_LANGUAGE_STANDARD = gnu99; 448 | GCC_DYNAMIC_NO_PIC = NO; 449 | GCC_NO_COMMON_BLOCKS = YES; 450 | GCC_OPTIMIZATION_LEVEL = 0; 451 | GCC_PREPROCESSOR_DEFINITIONS = ( 452 | "DEBUG=1", 453 | "$(inherited)", 454 | ); 455 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 456 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 457 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 458 | GCC_WARN_UNDECLARED_SELECTOR = YES; 459 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 460 | GCC_WARN_UNUSED_FUNCTION = YES; 461 | GCC_WARN_UNUSED_VARIABLE = YES; 462 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 463 | MTL_ENABLE_DEBUG_INFO = YES; 464 | ONLY_ACTIVE_ARCH = YES; 465 | SDKROOT = iphoneos; 466 | }; 467 | name = Debug; 468 | }; 469 | 893F200E1AE68CF1009D6A35 /* Release */ = { 470 | isa = XCBuildConfiguration; 471 | buildSettings = { 472 | ALWAYS_SEARCH_USER_PATHS = NO; 473 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 474 | CLANG_CXX_LIBRARY = "libc++"; 475 | CLANG_ENABLE_MODULES = YES; 476 | CLANG_ENABLE_OBJC_ARC = YES; 477 | CLANG_WARN_BOOL_CONVERSION = YES; 478 | CLANG_WARN_CONSTANT_CONVERSION = YES; 479 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 480 | CLANG_WARN_EMPTY_BODY = YES; 481 | CLANG_WARN_ENUM_CONVERSION = YES; 482 | CLANG_WARN_INT_CONVERSION = YES; 483 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 484 | CLANG_WARN_UNREACHABLE_CODE = YES; 485 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 486 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 487 | COPY_PHASE_STRIP = NO; 488 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 489 | ENABLE_NS_ASSERTIONS = NO; 490 | ENABLE_STRICT_OBJC_MSGSEND = YES; 491 | GCC_C_LANGUAGE_STANDARD = gnu99; 492 | GCC_NO_COMMON_BLOCKS = YES; 493 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 494 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 495 | GCC_WARN_UNDECLARED_SELECTOR = YES; 496 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 497 | GCC_WARN_UNUSED_FUNCTION = YES; 498 | GCC_WARN_UNUSED_VARIABLE = YES; 499 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 500 | MTL_ENABLE_DEBUG_INFO = NO; 501 | SDKROOT = iphoneos; 502 | VALIDATE_PRODUCT = YES; 503 | }; 504 | name = Release; 505 | }; 506 | 893F20101AE68CF1009D6A35 /* Debug */ = { 507 | isa = XCBuildConfiguration; 508 | buildSettings = { 509 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 510 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 511 | INFOPLIST_FILE = CoreLock/Info.plist; 512 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 513 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 514 | PRODUCT_NAME = "$(TARGET_NAME)"; 515 | }; 516 | name = Debug; 517 | }; 518 | 893F20111AE68CF1009D6A35 /* Release */ = { 519 | isa = XCBuildConfiguration; 520 | buildSettings = { 521 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 522 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 523 | INFOPLIST_FILE = CoreLock/Info.plist; 524 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 525 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 526 | PRODUCT_NAME = "$(TARGET_NAME)"; 527 | }; 528 | name = Release; 529 | }; 530 | 893F20131AE68CF1009D6A35 /* Debug */ = { 531 | isa = XCBuildConfiguration; 532 | buildSettings = { 533 | BUNDLE_LOADER = "$(TEST_HOST)"; 534 | FRAMEWORK_SEARCH_PATHS = ( 535 | "$(SDKROOT)/Developer/Library/Frameworks", 536 | "$(inherited)", 537 | ); 538 | GCC_PREPROCESSOR_DEFINITIONS = ( 539 | "DEBUG=1", 540 | "$(inherited)", 541 | ); 542 | INFOPLIST_FILE = CoreLockTests/Info.plist; 543 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 544 | PRODUCT_NAME = "$(TARGET_NAME)"; 545 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CoreLock.app/CoreLock"; 546 | }; 547 | name = Debug; 548 | }; 549 | 893F20141AE68CF1009D6A35 /* Release */ = { 550 | isa = XCBuildConfiguration; 551 | buildSettings = { 552 | BUNDLE_LOADER = "$(TEST_HOST)"; 553 | FRAMEWORK_SEARCH_PATHS = ( 554 | "$(SDKROOT)/Developer/Library/Frameworks", 555 | "$(inherited)", 556 | ); 557 | INFOPLIST_FILE = CoreLockTests/Info.plist; 558 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 559 | PRODUCT_NAME = "$(TARGET_NAME)"; 560 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CoreLock.app/CoreLock"; 561 | }; 562 | name = Release; 563 | }; 564 | /* End XCBuildConfiguration section */ 565 | 566 | /* Begin XCConfigurationList section */ 567 | 893F1FE71AE68CF1009D6A35 /* Build configuration list for PBXProject "CoreLock" */ = { 568 | isa = XCConfigurationList; 569 | buildConfigurations = ( 570 | 893F200D1AE68CF1009D6A35 /* Debug */, 571 | 893F200E1AE68CF1009D6A35 /* Release */, 572 | ); 573 | defaultConfigurationIsVisible = 0; 574 | defaultConfigurationName = Release; 575 | }; 576 | 893F200F1AE68CF1009D6A35 /* Build configuration list for PBXNativeTarget "CoreLock" */ = { 577 | isa = XCConfigurationList; 578 | buildConfigurations = ( 579 | 893F20101AE68CF1009D6A35 /* Debug */, 580 | 893F20111AE68CF1009D6A35 /* Release */, 581 | ); 582 | defaultConfigurationIsVisible = 0; 583 | defaultConfigurationName = Release; 584 | }; 585 | 893F20121AE68CF1009D6A35 /* Build configuration list for PBXNativeTarget "CoreLockTests" */ = { 586 | isa = XCConfigurationList; 587 | buildConfigurations = ( 588 | 893F20131AE68CF1009D6A35 /* Debug */, 589 | 893F20141AE68CF1009D6A35 /* Release */, 590 | ); 591 | defaultConfigurationIsVisible = 0; 592 | defaultConfigurationName = Release; 593 | }; 594 | /* End XCConfigurationList section */ 595 | }; 596 | rootObject = 893F1FE41AE68CF1009D6A35 /* Project object */; 597 | } 598 | --------------------------------------------------------------------------------