├── Pictures
└── demo_picture_1.png
├── SLPasswordInputView-Demo
├── SLPasswordInputView-Demo
│ ├── Assets.xcassets
│ │ ├── Contents.json
│ │ ├── cat.imageset
│ │ │ ├── cat.jpg
│ │ │ └── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── ViewController.h
│ ├── AppDelegate.h
│ ├── SLPasswordInputView
│ │ ├── UIImage+SLAdd.h
│ │ ├── UIImage+SLAdd.m
│ │ ├── SLPasswordInputView.h
│ │ └── SLPasswordInputView.m
│ ├── main.m
│ ├── Info.plist
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ ├── AppDelegate.m
│ └── ViewController.m
└── SLPasswordInputView-Demo.xcodeproj
│ ├── xcuserdata
│ └── zhangsl.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── SLPasswordInputView-Demo.xcscheme
│ ├── project.xcworkspace
│ └── contents.xcworkspacedata
│ └── project.pbxproj
├── .gitignore
├── LICENSE
├── README.md
└── SLPasswordInputView.podspec
/Pictures/demo_picture_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NewToolAI/SLPasswordInputView/HEAD/Pictures/demo_picture_1.png
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo.xcodeproj/xcuserdata/zhangsl.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/Assets.xcassets/cat.imageset/cat.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NewToolAI/SLPasswordInputView/HEAD/SLPasswordInputView-Demo/SLPasswordInputView-Demo/Assets.xcassets/cat.imageset/cat.jpg
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // SLPasswordInputView-Demo
4 | //
5 | // Created by zhangsl on 16/7/29.
6 | // Copyright © 2016年 zhangsl. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // SLPasswordInputView-Demo
4 | //
5 | // Created by zhangsl on 16/7/29.
6 | // Copyright © 2016年 zhangsl. 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 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/SLPasswordInputView/UIImage+SLAdd.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+SLAdd.h
3 | // SLPasswordInputView-Demo
4 | //
5 | // Created by zhangsl on 16/7/29.
6 | // Copyright © 2016年 zhangsl. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIImage (SLAdd)
12 |
13 | + (UIImage *)sl_dotImageWithColor:(UIColor *)color radius:(CGFloat)radius;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // SLPasswordInputView-Demo
4 | //
5 | // Created by zhangsl on 16/7/29.
6 | // Copyright © 2016年 zhangsl. 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 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/Assets.xcassets/cat.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "cat.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo.xcodeproj/xcuserdata/zhangsl.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | SLPasswordInputView-Demo.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | F9E492451D4AF12100BE9AEF
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | SLPasswordInputView-Demo/SLPasswordInputView-Demo.xcodeproj/project.xcworkspace/xcuserdata/zhangsl.xcuserdatad/UserInterfaceState.xcuserstate
3 |
4 | SLPasswordInputView-Demo/SLPasswordInputView-Demo.xcodeproj/project.xcworkspace/xcuserdata/zhangsl.xcuserdatad/UserInterfaceState.xcuserstate
5 |
6 | SLPasswordInputView-Demo/SLPasswordInputView-Demo.xcodeproj/project.xcworkspace/xcuserdata/zhangsl.xcuserdatad/UserInterfaceState.xcuserstate
7 |
8 | SLPasswordInputView-Demo/SLPasswordInputView-Demo.xcodeproj/project.xcworkspace/xcuserdata/zhangsl.xcuserdatad/UserInterfaceState.xcuserstate
9 |
10 | SLPasswordInputView-Demo/SLPasswordInputView-Demo.xcodeproj/project.xcworkspace/xcuserdata/zhangsl.xcuserdatad/UserInterfaceState.xcuserstate
11 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/SLPasswordInputView/UIImage+SLAdd.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+SLAdd.m
3 | // SLPasswordInputView-Demo
4 | //
5 | // Created by zhangsl on 16/7/29.
6 | // Copyright © 2016年 zhangsl. All rights reserved.
7 | //
8 |
9 | #import "UIImage+SLAdd.h"
10 |
11 | @implementation UIImage (SLAdd)
12 |
13 | + (UIImage *)sl_dotImageWithColor:(UIColor *)color radius:(CGFloat)radius {
14 | CGSize size = CGSizeMake(radius * 2, radius * 2);
15 | UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
16 |
17 | UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:(CGRect){0, 0, size}];
18 | [color set];
19 | [path fill];
20 |
21 | UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext();
22 |
23 | UIGraphicsEndImageContext();
24 |
25 | return resultImage;
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 zhangsl
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SLPasswordInputView
2 |
3 | ### 代理:
4 | - -(void)passwordInputView:(SLPasswordInputView *)inputView willBeginInputWithPassword:(NSString *)password;
5 | - -(void)passwordInputView:(SLPasswordInputView *)inputView willEndInputWithPassword:(NSString *)password;
6 | - -(void)passwordInputView:(SLPasswordInputView *)inputView didChangeInputWithPassword:(NSString *)password;
7 | - -(void)passwordInputView:(SLPasswordInputView *)inputView didFinishInputWithPassword:(NSString *)password;
8 |
9 | ### 属性
10 | - 密码长度
11 | - @property (assign, nonatomic) NSUInteger passwordLength;
12 | - 密码字符大小
13 | - @property (assign, nonatomic) CGFloat passwordWidth;
14 | - 密码字符颜色(只在使用默认密码字符图片时有效
15 | - @property (strong, nonatomic) UIColor *passwordColor;
16 | - 密码字符图片(正方形图片,默认为黑色圆点)
17 | - @property (strong, nonatomic) UIImage *passwordImage;
18 | - 显示边框
19 | - @property (assign, nonatomic) BOOL showBorder;
20 | - 边框圆角大小
21 | - @property (assign, nonatomic) CGFloat borderCornerRadius;
22 | - 边框线宽
23 | - @property (assign, nonatomic) CGFloat borderWidth;
24 | - 边框颜色
25 | - @property (strong, nonatomic) UIColor *borderColor;
26 | - 键盘类型
27 | - @property (assign, nonatomic) UIKeyboardType keyboardType;
28 | - 返回按钮类型
29 | - @property (assign, nonatomic) UIReturnKeyType returnKeyType;
30 | - 密码文本
31 | - @property (copy, nonatomic, nullable) NSString *passwordText;
32 | - 内边距
33 | - @property (assign, nonatomic) UIEdgeInsets contentInsets;
34 |
35 |
36 | 
37 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/Assets.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 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "83.5x83.5",
66 | "scale" : "2x"
67 | }
68 | ],
69 | "info" : {
70 | "version" : 1,
71 | "author" : "xcode"
72 | }
73 | }
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
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 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/SLPasswordInputView/SLPasswordInputView.h:
--------------------------------------------------------------------------------
1 | //
2 | // SLPasswordInputView.h
3 | // SLPasswordInputView-Demo
4 | //
5 | // Created by zhangsl on 16/7/29.
6 | // Copyright © 2016年 zhangsl. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class SLPasswordInputView;
12 |
13 | NS_ASSUME_NONNULL_BEGIN
14 |
15 | @protocol SLPasswordInputViewDelegate
16 |
17 | @optional
18 |
19 | - (void)passwordInputView:(SLPasswordInputView *)inputView willBeginInputWithPassword:(NSString *)password;
20 | - (void)passwordInputView:(SLPasswordInputView *)inputView willEndInputWithPassword:(NSString *)password;
21 | - (void)passwordInputView:(SLPasswordInputView *)inputView didChangeInputWithPassword:(NSString *)password;
22 | - (void)passwordInputView:(SLPasswordInputView *)inputView didFinishInputWithPassword:(NSString *)password;
23 |
24 | @end
25 |
26 | @interface SLPasswordInputView : UIView
27 |
28 | /** 密码长度 */
29 | @property (assign, nonatomic) NSUInteger passwordLength;
30 | /** 密码字符大小 */
31 | @property (assign, nonatomic) CGFloat passwordWidth;
32 | /** 密码字符颜色(只在使用默认密码字符图片时有效) */
33 | @property (strong, nonatomic) UIColor *passwordColor;
34 | /** 密码字符图片(正方形图片,默认为黑色圆点) */
35 | @property (strong, nonatomic) UIImage *passwordImage;
36 | /** 显示边框 */
37 | @property (assign, nonatomic) BOOL showBorder;
38 | /** 边框圆角大小 */
39 | @property (assign, nonatomic) CGFloat borderCornerRadius;
40 | /** 边框线宽 */
41 | @property (assign, nonatomic) CGFloat borderWidth;
42 | /** 边框颜色 */
43 | @property (strong, nonatomic) UIColor *borderColor;
44 | /** 键盘类型 */
45 | @property (assign, nonatomic) UIKeyboardType keyboardType;
46 | /** 返回按钮类型 */
47 | @property (assign, nonatomic) UIReturnKeyType returnKeyType;
48 | /** 密码文本 */
49 | @property (copy, nonatomic, nullable) NSString *passwordText;
50 | /** 内边距 */
51 | @property (assign, nonatomic) UIEdgeInsets contentInsets;
52 | /** 代理 */
53 | @property (weak, nonatomic) id delegate;
54 |
55 | @end
56 |
57 | NS_ASSUME_NONNULL_END
58 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // SLPasswordInputView-Demo
4 | //
5 | // Created by zhangsl on 16/7/29.
6 | // Copyright © 2016年 zhangsl. 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 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // SLPasswordInputView-Demo
4 | //
5 | // Created by zhangsl on 16/7/29.
6 | // Copyright © 2016年 zhangsl. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "SLPasswordInputView.h"
11 |
12 | #define kSLScreenWidth [UIScreen mainScreen].bounds.size.width
13 |
14 | @interface ViewController ()
15 |
16 | @end
17 |
18 | @implementation ViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 |
23 | SLPasswordInputView *inputView1 = [[SLPasswordInputView alloc]
24 | initWithFrame:CGRectMake(10, 30, kSLScreenWidth - 20, 54)];
25 | inputView1.backgroundColor = [UIColor whiteColor];
26 | inputView1.delegate = self;
27 | [self.view addSubview:inputView1];
28 |
29 | SLPasswordInputView *inputView2 = [[SLPasswordInputView alloc]
30 | initWithFrame:CGRectMake(10, 104, kSLScreenWidth - 20, 54)];
31 | inputView2.backgroundColor = [UIColor whiteColor];
32 | inputView2.showBorder = NO;
33 | inputView2.backgroundColor = [UIColor yellowColor];
34 | inputView2.passwordColor = [UIColor cyanColor];
35 | inputView2.passwordWidth = 15;
36 | inputView2.delegate = self;
37 | inputView2.keyboardType = UIKeyboardTypeAlphabet;
38 | [self.view addSubview:inputView2];
39 |
40 | SLPasswordInputView *inputView3 = [[SLPasswordInputView alloc] initWithFrame:CGRectMake(10, 178, kSLScreenWidth - 20, 88)];
41 | inputView3.backgroundColor = [UIColor cyanColor];
42 | inputView3.passwordColor = [UIColor yellowColor];
43 | inputView3.passwordLength = 5;
44 | inputView3.borderColor = [UIColor grayColor];
45 | inputView3.contentInsets = UIEdgeInsetsMake(10, 10, 10, 10);
46 | inputView3.borderCornerRadius = 10;
47 | inputView3.delegate = self;
48 | [self.view addSubview:inputView3];
49 |
50 | SLPasswordInputView *inputView4 = [[SLPasswordInputView alloc] initWithFrame:CGRectMake(10, 286, kSLScreenWidth - 20, 88)];
51 | inputView4.passwordImage = [UIImage imageNamed:@"cat.jpg"];
52 | inputView4.passwordLength = 5;
53 | inputView4.passwordWidth = 30;
54 | inputView4.borderCornerRadius = 10;
55 | inputView4.borderColor = [UIColor orangeColor];
56 | inputView4.borderWidth = 3;
57 | inputView4.keyboardType = UIKeyboardTypeAlphabet;
58 | inputView4.delegate = self;
59 | [self.view addSubview:inputView4];
60 | }
61 |
62 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
63 | [self.view endEditing:YES];
64 | }
65 |
66 | - (void)passwordInputView:(SLPasswordInputView *)inputView willBeginInputWithPassword:(NSString *)password {
67 | NSLog(@"inputBegin");
68 | }
69 |
70 | - (void)passwordInputView:(SLPasswordInputView *)inputView willEndInputWithPassword:(NSString *)password {
71 | NSLog(@"inputEnd");
72 | }
73 |
74 | - (void)passwordInputView:(SLPasswordInputView *)inputView didChangeInputWithPassword:(NSString *)password {
75 | NSLog(@"inputChanged, passwd:%@", password);
76 | }
77 |
78 | - (void)passwordInputView:(SLPasswordInputView *)inputView didFinishInputWithPassword:(NSString *)password {
79 | NSLog(@"inputFinished, passwd:%@", password);
80 | }
81 |
82 | @end
83 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo.xcodeproj/xcuserdata/zhangsl.xcuserdatad/xcschemes/SLPasswordInputView-Demo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/SLPasswordInputView.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod spec lint SLPasswordInputView.podspec' to ensure this is a
3 | # valid spec and to remove all comments including this before submitting the spec.
4 | #
5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
7 | #
8 |
9 | Pod::Spec.new do |s|
10 |
11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
12 | #
13 | # These will help people to find your library, and whilst it
14 | # can feel like a chore to fill in it's definitely to your advantage. The
15 | # summary should be tweet-length, and the description more in depth.
16 | #
17 |
18 | s.name = "SLPasswordInputView"
19 | s.version = "0.0.1"
20 | s.summary = "A password input view, easy to use. (一个密码输入控件)"
21 |
22 | # This description is used to generate tags and improve search results.
23 | # * Think: What does it do? Why did you write it? What is the focus?
24 | # * Try to keep it short, snappy and to the point.
25 | # * Write the description between the DESC delimiters below.
26 | # * Finally, don't worry about the indent, CocoaPods strips it!
27 | s.description = "A password input view, easy to use. 一个密码输入控件,仿微信支付。使用简单,可定制性高"
28 |
29 |
30 | s.homepage = "https://github.com/Coderzhangsl/SLPasswordInputView"
31 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
32 |
33 |
34 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
35 | #
36 | # Licensing your code is important. See http://choosealicense.com for more info.
37 | # CocoaPods will detect a license file if there is a named LICENSE*
38 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
39 | #
40 |
41 | s.license = "MIT"
42 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" }
43 |
44 |
45 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
46 | #
47 | # Specify the authors of the library, with email addresses. Email addresses
48 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
49 | # accepts just a name if you'd rather not provide an email address.
50 | #
51 | # Specify a social_media_url where others can refer to, for example a twitter
52 | # profile URL.
53 | #
54 |
55 | s.author = { "Coderzhangsl" => "zhangslwork@yeah.net" }
56 | # Or just: s.author = "Coderzhangsl"
57 | # s.authors = { "Coderzhangsl" => "" }
58 | # s.social_media_url = "http://twitter.com/Coderzhangsl"
59 |
60 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
61 | #
62 | # If this Pod runs only on iOS or OS X, then specify the platform and
63 | # the deployment target. You can optionally include the target after the platform.
64 | #
65 |
66 | s.platform = :ios
67 | # s.platform = :ios, "5.0"
68 |
69 | # When using multiple platforms
70 | # s.ios.deployment_target = "5.0"
71 | # s.osx.deployment_target = "10.7"
72 | # s.watchos.deployment_target = "2.0"
73 | # s.tvos.deployment_target = "9.0"
74 |
75 |
76 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
77 | #
78 | # Specify the location from where the source should be retrieved.
79 | # Supports git, hg, bzr, svn and HTTP.
80 | #
81 |
82 | s.source = { :git => "https://github.com/Coderzhangsl/SLPasswordInputView.git", :tag => "0.0.1" }
83 |
84 |
85 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
86 | #
87 | # CocoaPods is smart about how it includes source code. For source files
88 | # giving a folder will include any swift, h, m, mm, c & cpp files.
89 | # For header files it will include any header in the folder.
90 | # Not including the public_header_files will make all headers public.
91 | #
92 |
93 | s.source_files = "SLPasswordInputView-Demo/SLPasswordInputView-Demo/SLPasswordInputView", "SLPasswordInputView-Demo/SLPasswordInputView-Demo/SLPasswordInputView/**/*.{h,m}"
94 | # s.exclude_files = "Classes/Exclude"
95 |
96 | # s.public_header_files = "Classes/**/*.h"
97 |
98 |
99 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
100 | #
101 | # A list of resources included with the Pod. These are copied into the
102 | # target bundle with a build phase script. Anything else will be cleaned.
103 | # You can preserve files from being cleaned, please don't preserve
104 | # non-essential files like tests, examples and documentation.
105 | #
106 |
107 | # s.resource = "icon.png"
108 | # s.resources = "Resources/*.png"
109 |
110 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave"
111 |
112 |
113 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
114 | #
115 | # Link your library with frameworks, or libraries. Libraries do not include
116 | # the lib prefix of their name.
117 | #
118 |
119 | # s.framework = "SomeFramework"
120 | # s.frameworks = "SomeFramework", "AnotherFramework"
121 |
122 | # s.library = "iconv"
123 | # s.libraries = "iconv", "xml2"
124 |
125 |
126 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
127 | #
128 | # If your library depends on compiler flags you can set them in the xcconfig hash
129 | # where they will only apply to your library. If you depend on other Podspecs
130 | # you can include multiple dependencies to ensure it works.
131 |
132 | # s.requires_arc = true
133 |
134 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
135 | # s.dependency "JSONKit", "~> 1.4"
136 |
137 | end
138 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo/SLPasswordInputView/SLPasswordInputView.m:
--------------------------------------------------------------------------------
1 | //
2 | // SLPasswordInputView.m
3 | // SLPasswordInputView-Demo
4 | //
5 | // Created by zhangsl on 16/7/29.
6 | // Copyright © 2016年 zhangsl. All rights reserved.
7 | //
8 |
9 | #import "SLPasswordInputView.h"
10 | #import "UIImage+SLAdd.h"
11 |
12 | @interface SLPasswordInputView ()
13 |
14 | @property (strong, nonatomic) NSMutableString *passwordStore;
15 |
16 | @end
17 |
18 | @implementation SLPasswordInputView
19 |
20 | //------------------------------------------------------------------------------
21 | #pragma mark - Init & Dealloc
22 | //------------------------------------------------------------------------------
23 |
24 | - (instancetype)initWithFrame:(CGRect)frame {
25 | self = [super initWithFrame:frame];
26 | if (self) {
27 | [self commonInit];
28 | }
29 |
30 | return self;
31 | }
32 |
33 | - (instancetype)initWithCoder:(NSCoder *)aDecoder {
34 | self = [super initWithCoder:aDecoder];
35 | if (self) {
36 | [self commonInit];
37 | }
38 |
39 | return self;
40 | }
41 |
42 | - (void)commonInit {
43 | _passwordLength = 8;
44 | _passwordWidth = 17;
45 | _passwordColor = [UIColor blackColor];
46 | _showBorder = YES;
47 | _borderCornerRadius = 0;
48 | _borderWidth = 1;
49 | _borderColor = [UIColor lightGrayColor];
50 | _keyboardType = UIKeyboardTypeNumberPad;
51 | _returnKeyType = UIReturnKeyDefault;
52 | _passwordStore = [NSMutableString string];
53 | self.backgroundColor = [UIColor whiteColor];
54 | }
55 |
56 | //------------------------------------------------------------------------------
57 | #pragma mark - Override
58 | //------------------------------------------------------------------------------
59 |
60 | - (BOOL)canBecomeFirstResponder {
61 | return YES;
62 | }
63 |
64 | - (void)drawRect:(CGRect)rect {
65 | CGRect drawRect = UIEdgeInsetsInsetRect(rect, self.contentInsets);
66 | CGFloat drawRectX = drawRect.origin.x;
67 | CGFloat drawRectY = drawRect.origin.y;
68 | CGFloat charRectWidth = drawRect.size.width / self.passwordLength;
69 | CGFloat charRectHeight = drawRect.size.height;
70 | CGFloat charNumber = self.passwordLength;
71 | UIImage *drawImage = self.passwordImage ? : [UIImage sl_dotImageWithColor:self.passwordColor radius:self.passwordWidth * 0.5];
72 |
73 | if (self.showBorder) {
74 | UIBezierPath *borderPath = [UIBezierPath bezierPathWithRoundedRect:drawRect cornerRadius:self.borderCornerRadius];
75 |
76 | for (int i = 1; i < charNumber; i++) {
77 | [borderPath moveToPoint:CGPointMake(drawRectX + charRectWidth * i, drawRectY)];
78 | [borderPath addLineToPoint:CGPointMake(drawRectX + charRectWidth * i, drawRectY + charRectHeight)];
79 | }
80 |
81 | borderPath.lineWidth = self.borderWidth;
82 |
83 | [self.borderColor setStroke];
84 | [borderPath stroke];
85 | }
86 |
87 | CGFloat pcX = drawRectX + charRectWidth * 0.5 - self.passwordWidth * 0.5;
88 | CGFloat pcY = drawRectY + charRectHeight * 0.5 - self.passwordWidth * 0.5;
89 | CGFloat pcW = self.passwordWidth;
90 | CGFloat pcH = self.passwordWidth;
91 | CGRect passwordCharRect = CGRectMake(pcX, pcY, pcW, pcH);
92 |
93 | passwordCharRect.origin.x -= charRectWidth;
94 | for (int i = 0; i < self.passwordStore.length; i++) {
95 | passwordCharRect.origin.x += charRectWidth;
96 | [drawImage drawInRect:passwordCharRect];
97 | }
98 | }
99 |
100 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
101 | if (!self.isFirstResponder) {
102 | [self becomeFirstResponder];
103 | }
104 | }
105 |
106 | - (BOOL)becomeFirstResponder {
107 | [self callDelegateWhenInputWillBegin];
108 |
109 | return [super becomeFirstResponder];
110 | }
111 |
112 | - (BOOL)resignFirstResponder {
113 | [self callDelegateWhenInputWillEnd];
114 |
115 | return [super resignFirstResponder];
116 | }
117 |
118 | //------------------------------------------------------------------------------
119 | #pragma mark - Private Method
120 | //------------------------------------------------------------------------------
121 |
122 | - (void)callDelegateWhenInputWillBegin {
123 | if ([self.delegate respondsToSelector:@selector(passwordInputView:willBeginInputWithPassword:)]) {
124 | [self.delegate passwordInputView:self willBeginInputWithPassword:self.passwordText];
125 | }
126 | }
127 |
128 | - (void)callDelegateWhenInputWillEnd {
129 | if ([self.delegate respondsToSelector:@selector(passwordInputView:willEndInputWithPassword:)]) {
130 | [self.delegate passwordInputView:self willEndInputWithPassword:self.passwordText];
131 | }
132 | }
133 |
134 | - (void)callDelegateWhenInputChange {
135 | if ([self.delegate respondsToSelector:@selector(passwordInputView:didChangeInputWithPassword:)]) {
136 | [self.delegate passwordInputView:self didChangeInputWithPassword:self.passwordText];
137 | }
138 | }
139 |
140 | - (void)callDelegateWhenInputFinshed {
141 | if ([self.delegate respondsToSelector:@selector(passwordInputView:didFinishInputWithPassword:)]) {
142 | [self.delegate passwordInputView:self didFinishInputWithPassword:self.passwordText];
143 | }
144 | }
145 |
146 | //------------------------------------------------------------------------------
147 | #pragma mark - UIKeyInput
148 | //------------------------------------------------------------------------------
149 |
150 | - (void)insertText:(NSString *)text {
151 | if (self.passwordStore.length >= self.passwordLength) {
152 | return;
153 | }
154 |
155 | [self.passwordStore appendString:text];
156 |
157 | [self setNeedsDisplay];
158 |
159 | [self callDelegateWhenInputChange];
160 | if (self.passwordStore.length >= self.passwordLength) {
161 | [self callDelegateWhenInputFinshed];
162 | }
163 | }
164 |
165 | - (void)deleteBackward {
166 | if (self.passwordStore.length <= 0) {
167 | return;
168 | }
169 |
170 | [self.passwordStore deleteCharactersInRange:NSMakeRange(self.passwordStore.length - 1, 1)];
171 |
172 | [self setNeedsDisplay];
173 |
174 | [self callDelegateWhenInputChange];
175 | }
176 |
177 | - (BOOL)hasText {
178 | return self.passwordStore.length;
179 | }
180 |
181 | //------------------------------------------------------------------------------
182 | #pragma mark - Setter & Getter
183 | //------------------------------------------------------------------------------
184 |
185 | - (void)setPasswordColor:(UIColor *)passwordColor {
186 | _passwordColor = passwordColor;
187 |
188 | [self setNeedsDisplay];
189 | }
190 |
191 | - (void)setPasswordImage:(UIImage *)passwordImage {
192 | _passwordImage = passwordImage;
193 |
194 | [self setNeedsDisplay];
195 | }
196 |
197 | - (void)setPasswordWidth:(CGFloat)passwordWidth {
198 | _passwordWidth = passwordWidth;
199 |
200 | [self setNeedsDisplay];
201 | }
202 |
203 | - (void)setPasswordLength:(NSUInteger)passwordLength {
204 | _passwordLength = passwordLength;
205 |
206 | [self setNeedsDisplay];
207 | }
208 |
209 | - (void)setBorderColor:(UIColor *)borderColor {
210 | _borderColor = borderColor;
211 |
212 | [self setNeedsDisplay];
213 | }
214 |
215 | - (void)setBorderWidth:(CGFloat)borderWidth {
216 | _borderWidth = borderWidth;
217 |
218 | [self setNeedsDisplay];
219 | }
220 |
221 | - (void)setBorderCornerRadius:(CGFloat)borderCornerRadius {
222 | _borderCornerRadius = borderCornerRadius;
223 |
224 | [self setNeedsDisplay];
225 | }
226 |
227 | - (void)setShowBorder:(BOOL)showBorder {
228 | _showBorder = showBorder;
229 |
230 | [self setNeedsDisplay];
231 | }
232 |
233 | - (void)setPasswordText:(NSString *)passwordText {
234 | if (passwordText.length > self.passwordLength) {
235 | self.passwordStore = [[passwordText substringToIndex:self.passwordLength] mutableCopy];
236 | } else {
237 | self.passwordStore = [passwordText mutableCopy];
238 | }
239 |
240 | [self setNeedsDisplay];
241 | }
242 |
243 | - (void)setContentInsets:(UIEdgeInsets)contentInsets {
244 | _contentInsets = contentInsets;
245 |
246 | [self setNeedsDisplay];
247 | }
248 |
249 | - (NSString *)passwordText {
250 | return [self.passwordStore copy];
251 | }
252 |
253 | @end
254 |
--------------------------------------------------------------------------------
/SLPasswordInputView-Demo/SLPasswordInputView-Demo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | F9E4924B1D4AF12100BE9AEF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F9E4924A1D4AF12100BE9AEF /* main.m */; };
11 | F9E4924E1D4AF12100BE9AEF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F9E4924D1D4AF12100BE9AEF /* AppDelegate.m */; };
12 | F9E492511D4AF12100BE9AEF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F9E492501D4AF12100BE9AEF /* ViewController.m */; };
13 | F9E492541D4AF12100BE9AEF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F9E492521D4AF12100BE9AEF /* Main.storyboard */; };
14 | F9E492561D4AF12100BE9AEF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F9E492551D4AF12100BE9AEF /* Assets.xcassets */; };
15 | F9E492591D4AF12100BE9AEF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F9E492571D4AF12100BE9AEF /* LaunchScreen.storyboard */; };
16 | F9E492631D4AF18500BE9AEF /* SLPasswordInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = F9E492621D4AF18500BE9AEF /* SLPasswordInputView.m */; };
17 | F9E492661D4AF79F00BE9AEF /* UIImage+SLAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = F9E492651D4AF79F00BE9AEF /* UIImage+SLAdd.m */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXFileReference section */
21 | F9E492461D4AF12100BE9AEF /* SLPasswordInputView-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SLPasswordInputView-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; };
22 | F9E4924A1D4AF12100BE9AEF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
23 | F9E4924C1D4AF12100BE9AEF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
24 | F9E4924D1D4AF12100BE9AEF /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
25 | F9E4924F1D4AF12100BE9AEF /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
26 | F9E492501D4AF12100BE9AEF /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
27 | F9E492531D4AF12100BE9AEF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
28 | F9E492551D4AF12100BE9AEF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
29 | F9E492581D4AF12100BE9AEF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
30 | F9E4925A1D4AF12100BE9AEF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
31 | F9E492611D4AF18500BE9AEF /* SLPasswordInputView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SLPasswordInputView.h; sourceTree = ""; };
32 | F9E492621D4AF18500BE9AEF /* SLPasswordInputView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SLPasswordInputView.m; sourceTree = ""; };
33 | F9E492641D4AF79F00BE9AEF /* UIImage+SLAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+SLAdd.h"; sourceTree = ""; };
34 | F9E492651D4AF79F00BE9AEF /* UIImage+SLAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+SLAdd.m"; sourceTree = ""; };
35 | /* End PBXFileReference section */
36 |
37 | /* Begin PBXFrameworksBuildPhase section */
38 | F9E492431D4AF12100BE9AEF /* Frameworks */ = {
39 | isa = PBXFrameworksBuildPhase;
40 | buildActionMask = 2147483647;
41 | files = (
42 | );
43 | runOnlyForDeploymentPostprocessing = 0;
44 | };
45 | /* End PBXFrameworksBuildPhase section */
46 |
47 | /* Begin PBXGroup section */
48 | F9E4923D1D4AF12100BE9AEF = {
49 | isa = PBXGroup;
50 | children = (
51 | F9E492481D4AF12100BE9AEF /* SLPasswordInputView-Demo */,
52 | F9E492471D4AF12100BE9AEF /* Products */,
53 | );
54 | sourceTree = "";
55 | };
56 | F9E492471D4AF12100BE9AEF /* Products */ = {
57 | isa = PBXGroup;
58 | children = (
59 | F9E492461D4AF12100BE9AEF /* SLPasswordInputView-Demo.app */,
60 | );
61 | name = Products;
62 | sourceTree = "";
63 | };
64 | F9E492481D4AF12100BE9AEF /* SLPasswordInputView-Demo */ = {
65 | isa = PBXGroup;
66 | children = (
67 | F9E492601D4AF14300BE9AEF /* SLPasswordInputView */,
68 | F9E4924F1D4AF12100BE9AEF /* ViewController.h */,
69 | F9E492501D4AF12100BE9AEF /* ViewController.m */,
70 | F9E492491D4AF12100BE9AEF /* Supporting Files */,
71 | );
72 | path = "SLPasswordInputView-Demo";
73 | sourceTree = "";
74 | };
75 | F9E492491D4AF12100BE9AEF /* Supporting Files */ = {
76 | isa = PBXGroup;
77 | children = (
78 | F9E4924C1D4AF12100BE9AEF /* AppDelegate.h */,
79 | F9E4924D1D4AF12100BE9AEF /* AppDelegate.m */,
80 | F9E492521D4AF12100BE9AEF /* Main.storyboard */,
81 | F9E492551D4AF12100BE9AEF /* Assets.xcassets */,
82 | F9E492571D4AF12100BE9AEF /* LaunchScreen.storyboard */,
83 | F9E4925A1D4AF12100BE9AEF /* Info.plist */,
84 | F9E4924A1D4AF12100BE9AEF /* main.m */,
85 | );
86 | name = "Supporting Files";
87 | sourceTree = "";
88 | };
89 | F9E492601D4AF14300BE9AEF /* SLPasswordInputView */ = {
90 | isa = PBXGroup;
91 | children = (
92 | F9E492611D4AF18500BE9AEF /* SLPasswordInputView.h */,
93 | F9E492621D4AF18500BE9AEF /* SLPasswordInputView.m */,
94 | F9E492641D4AF79F00BE9AEF /* UIImage+SLAdd.h */,
95 | F9E492651D4AF79F00BE9AEF /* UIImage+SLAdd.m */,
96 | );
97 | path = SLPasswordInputView;
98 | sourceTree = "";
99 | };
100 | /* End PBXGroup section */
101 |
102 | /* Begin PBXNativeTarget section */
103 | F9E492451D4AF12100BE9AEF /* SLPasswordInputView-Demo */ = {
104 | isa = PBXNativeTarget;
105 | buildConfigurationList = F9E4925D1D4AF12100BE9AEF /* Build configuration list for PBXNativeTarget "SLPasswordInputView-Demo" */;
106 | buildPhases = (
107 | F9E492421D4AF12100BE9AEF /* Sources */,
108 | F9E492431D4AF12100BE9AEF /* Frameworks */,
109 | F9E492441D4AF12100BE9AEF /* Resources */,
110 | );
111 | buildRules = (
112 | );
113 | dependencies = (
114 | );
115 | name = "SLPasswordInputView-Demo";
116 | productName = "SLPasswordInputView-Demo";
117 | productReference = F9E492461D4AF12100BE9AEF /* SLPasswordInputView-Demo.app */;
118 | productType = "com.apple.product-type.application";
119 | };
120 | /* End PBXNativeTarget section */
121 |
122 | /* Begin PBXProject section */
123 | F9E4923E1D4AF12100BE9AEF /* Project object */ = {
124 | isa = PBXProject;
125 | attributes = {
126 | LastUpgradeCheck = 0730;
127 | ORGANIZATIONNAME = zhangsl;
128 | TargetAttributes = {
129 | F9E492451D4AF12100BE9AEF = {
130 | CreatedOnToolsVersion = 7.3.1;
131 | DevelopmentTeam = BKAJ89SA22;
132 | };
133 | };
134 | };
135 | buildConfigurationList = F9E492411D4AF12100BE9AEF /* Build configuration list for PBXProject "SLPasswordInputView-Demo" */;
136 | compatibilityVersion = "Xcode 3.2";
137 | developmentRegion = English;
138 | hasScannedForEncodings = 0;
139 | knownRegions = (
140 | en,
141 | Base,
142 | );
143 | mainGroup = F9E4923D1D4AF12100BE9AEF;
144 | productRefGroup = F9E492471D4AF12100BE9AEF /* Products */;
145 | projectDirPath = "";
146 | projectRoot = "";
147 | targets = (
148 | F9E492451D4AF12100BE9AEF /* SLPasswordInputView-Demo */,
149 | );
150 | };
151 | /* End PBXProject section */
152 |
153 | /* Begin PBXResourcesBuildPhase section */
154 | F9E492441D4AF12100BE9AEF /* Resources */ = {
155 | isa = PBXResourcesBuildPhase;
156 | buildActionMask = 2147483647;
157 | files = (
158 | F9E492591D4AF12100BE9AEF /* LaunchScreen.storyboard in Resources */,
159 | F9E492561D4AF12100BE9AEF /* Assets.xcassets in Resources */,
160 | F9E492541D4AF12100BE9AEF /* Main.storyboard in Resources */,
161 | );
162 | runOnlyForDeploymentPostprocessing = 0;
163 | };
164 | /* End PBXResourcesBuildPhase section */
165 |
166 | /* Begin PBXSourcesBuildPhase section */
167 | F9E492421D4AF12100BE9AEF /* Sources */ = {
168 | isa = PBXSourcesBuildPhase;
169 | buildActionMask = 2147483647;
170 | files = (
171 | F9E492511D4AF12100BE9AEF /* ViewController.m in Sources */,
172 | F9E492631D4AF18500BE9AEF /* SLPasswordInputView.m in Sources */,
173 | F9E492661D4AF79F00BE9AEF /* UIImage+SLAdd.m in Sources */,
174 | F9E4924E1D4AF12100BE9AEF /* AppDelegate.m in Sources */,
175 | F9E4924B1D4AF12100BE9AEF /* main.m in Sources */,
176 | );
177 | runOnlyForDeploymentPostprocessing = 0;
178 | };
179 | /* End PBXSourcesBuildPhase section */
180 |
181 | /* Begin PBXVariantGroup section */
182 | F9E492521D4AF12100BE9AEF /* Main.storyboard */ = {
183 | isa = PBXVariantGroup;
184 | children = (
185 | F9E492531D4AF12100BE9AEF /* Base */,
186 | );
187 | name = Main.storyboard;
188 | sourceTree = "";
189 | };
190 | F9E492571D4AF12100BE9AEF /* LaunchScreen.storyboard */ = {
191 | isa = PBXVariantGroup;
192 | children = (
193 | F9E492581D4AF12100BE9AEF /* Base */,
194 | );
195 | name = LaunchScreen.storyboard;
196 | sourceTree = "";
197 | };
198 | /* End PBXVariantGroup section */
199 |
200 | /* Begin XCBuildConfiguration section */
201 | F9E4925B1D4AF12100BE9AEF /* Debug */ = {
202 | isa = XCBuildConfiguration;
203 | buildSettings = {
204 | ALWAYS_SEARCH_USER_PATHS = NO;
205 | CLANG_ANALYZER_NONNULL = YES;
206 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
207 | CLANG_CXX_LIBRARY = "libc++";
208 | CLANG_ENABLE_MODULES = YES;
209 | CLANG_ENABLE_OBJC_ARC = YES;
210 | CLANG_WARN_BOOL_CONVERSION = YES;
211 | CLANG_WARN_CONSTANT_CONVERSION = YES;
212 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
213 | CLANG_WARN_EMPTY_BODY = YES;
214 | CLANG_WARN_ENUM_CONVERSION = YES;
215 | CLANG_WARN_INT_CONVERSION = YES;
216 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
217 | CLANG_WARN_UNREACHABLE_CODE = YES;
218 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
219 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
220 | COPY_PHASE_STRIP = NO;
221 | DEBUG_INFORMATION_FORMAT = dwarf;
222 | ENABLE_STRICT_OBJC_MSGSEND = YES;
223 | ENABLE_TESTABILITY = YES;
224 | GCC_C_LANGUAGE_STANDARD = gnu99;
225 | GCC_DYNAMIC_NO_PIC = NO;
226 | GCC_NO_COMMON_BLOCKS = YES;
227 | GCC_OPTIMIZATION_LEVEL = 0;
228 | GCC_PREPROCESSOR_DEFINITIONS = (
229 | "DEBUG=1",
230 | "$(inherited)",
231 | );
232 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
233 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
234 | GCC_WARN_UNDECLARED_SELECTOR = YES;
235 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
236 | GCC_WARN_UNUSED_FUNCTION = YES;
237 | GCC_WARN_UNUSED_VARIABLE = YES;
238 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
239 | MTL_ENABLE_DEBUG_INFO = YES;
240 | ONLY_ACTIVE_ARCH = YES;
241 | SDKROOT = iphoneos;
242 | TARGETED_DEVICE_FAMILY = "1,2";
243 | };
244 | name = Debug;
245 | };
246 | F9E4925C1D4AF12100BE9AEF /* Release */ = {
247 | isa = XCBuildConfiguration;
248 | buildSettings = {
249 | ALWAYS_SEARCH_USER_PATHS = NO;
250 | CLANG_ANALYZER_NONNULL = YES;
251 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
252 | CLANG_CXX_LIBRARY = "libc++";
253 | CLANG_ENABLE_MODULES = YES;
254 | CLANG_ENABLE_OBJC_ARC = YES;
255 | CLANG_WARN_BOOL_CONVERSION = YES;
256 | CLANG_WARN_CONSTANT_CONVERSION = YES;
257 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
258 | CLANG_WARN_EMPTY_BODY = YES;
259 | CLANG_WARN_ENUM_CONVERSION = YES;
260 | CLANG_WARN_INT_CONVERSION = YES;
261 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
262 | CLANG_WARN_UNREACHABLE_CODE = YES;
263 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
264 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
265 | COPY_PHASE_STRIP = NO;
266 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
267 | ENABLE_NS_ASSERTIONS = NO;
268 | ENABLE_STRICT_OBJC_MSGSEND = YES;
269 | GCC_C_LANGUAGE_STANDARD = gnu99;
270 | GCC_NO_COMMON_BLOCKS = YES;
271 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
272 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
273 | GCC_WARN_UNDECLARED_SELECTOR = YES;
274 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
275 | GCC_WARN_UNUSED_FUNCTION = YES;
276 | GCC_WARN_UNUSED_VARIABLE = YES;
277 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
278 | MTL_ENABLE_DEBUG_INFO = NO;
279 | SDKROOT = iphoneos;
280 | TARGETED_DEVICE_FAMILY = "1,2";
281 | VALIDATE_PRODUCT = YES;
282 | };
283 | name = Release;
284 | };
285 | F9E4925E1D4AF12100BE9AEF /* Debug */ = {
286 | isa = XCBuildConfiguration;
287 | buildSettings = {
288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
289 | CODE_SIGN_IDENTITY = "iPhone Developer";
290 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
291 | INFOPLIST_FILE = "SLPasswordInputView-Demo/Info.plist";
292 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
294 | PRODUCT_BUNDLE_IDENTIFIER = "zhangsl.SLPasswordInputView-Demo";
295 | PRODUCT_NAME = "$(TARGET_NAME)";
296 | PROVISIONING_PROFILE = "";
297 | };
298 | name = Debug;
299 | };
300 | F9E4925F1D4AF12100BE9AEF /* Release */ = {
301 | isa = XCBuildConfiguration;
302 | buildSettings = {
303 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
304 | CODE_SIGN_IDENTITY = "iPhone Developer";
305 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
306 | INFOPLIST_FILE = "SLPasswordInputView-Demo/Info.plist";
307 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
308 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
309 | PRODUCT_BUNDLE_IDENTIFIER = "zhangsl.SLPasswordInputView-Demo";
310 | PRODUCT_NAME = "$(TARGET_NAME)";
311 | PROVISIONING_PROFILE = "";
312 | };
313 | name = Release;
314 | };
315 | /* End XCBuildConfiguration section */
316 |
317 | /* Begin XCConfigurationList section */
318 | F9E492411D4AF12100BE9AEF /* Build configuration list for PBXProject "SLPasswordInputView-Demo" */ = {
319 | isa = XCConfigurationList;
320 | buildConfigurations = (
321 | F9E4925B1D4AF12100BE9AEF /* Debug */,
322 | F9E4925C1D4AF12100BE9AEF /* Release */,
323 | );
324 | defaultConfigurationIsVisible = 0;
325 | defaultConfigurationName = Release;
326 | };
327 | F9E4925D1D4AF12100BE9AEF /* Build configuration list for PBXNativeTarget "SLPasswordInputView-Demo" */ = {
328 | isa = XCConfigurationList;
329 | buildConfigurations = (
330 | F9E4925E1D4AF12100BE9AEF /* Debug */,
331 | F9E4925F1D4AF12100BE9AEF /* Release */,
332 | );
333 | defaultConfigurationIsVisible = 0;
334 | defaultConfigurationName = Release;
335 | };
336 | /* End XCConfigurationList section */
337 | };
338 | rootObject = F9E4923E1D4AF12100BE9AEF /* Project object */;
339 | }
340 |
--------------------------------------------------------------------------------