-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewController.m
More file actions
47 lines (31 loc) · 1.01 KB
/
ViewController.m
File metadata and controls
47 lines (31 loc) · 1.01 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
//
// ViewController.m
// DDTimerButton
//
// Created by xiaomingsong on 11/8/15.
// Copyright © 2015 xiaomingsong. All rights reserved.
//
#import "ViewController.h"
#import "DDTimerButton.h"
@interface ViewController ()
@property (strong, nonatomic) DDTimerButton *b1;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
_b1 = [[DDTimerButton alloc] initWithInterval:60 title:@"发送验证码" withIdentifier:@"code"];
_b1.sendVerifyCodeBlock = ^{return YES;};
__weak ViewController *weakSelf = self;
_b1.finishVerifyBlock = ^{
[weakSelf.b1 setTitle:@"重新发送" forState:UIControlStateNormal];
};
[_b1 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[_b1 sizeToFit];
_b1.frame = CGRectMake(100, 200, 200, 32);
[self.view addSubview:self.b1];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end