-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathViewController.m
More file actions
62 lines (42 loc) · 1.59 KB
/
ViewController.m
File metadata and controls
62 lines (42 loc) · 1.59 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// ViewController.m
// ZZRAuthCodeEnterTextView
//
// Created by 张忠瑞 on 2018/4/12.
// Copyright © 2018年 张忠瑞. All rights reserved.
//
#import "ViewController.h"
#import "ZZRTextView.h"
#define WIDTH [UIScreen mainScreen].bounds.size.width
#define HEIGHT [UIScreen mainScreen].bounds.size.height
@interface ViewController ()<ZZRTextViewDelegate>
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
ZZRTextView *textView = [[ZZRTextView alloc] initWithFrame:CGRectMake(10, 100, WIDTH-20, 50) CodeSize:CGSizeMake(50, 50) MaxCount:6];
[textView setUpBorderWithNormalBorderColor:[UIColor lightGrayColor]
HighlightBorderColor:[UIColor darkGrayColor]
BorderWidth:1.0
BorderCornerRadius:5.0];
[textView setUpTextWithNormalTextColor:[UIColor blackColor]
HighlightTextColor:[UIColor blackColor]
TextFont:[UIFont systemFontOfSize:20]
TextAlignment:NSTextAlignmentCenter
KeyboardType:UIKeyboardTypeNumberPad];
textView.delegate = self;
textView.textFinished = ^(NSString *codeStr){
NSLog(@"block out -- %@",codeStr);
};
[self.view addSubview:textView];
}
- (void)ZZRTextViewDidFinishedEdit:(NSString *)codeStr
{
NSLog(@"delegate out -- %@",codeStr);
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end