14
14
15
15
@interface SettingEmailViewController ()<UITableViewDataSource, UITableViewDelegate>
16
16
@property (strong , nonatomic ) TPKeyboardAvoidingTableView *myTableView;
17
+ @property (strong , nonatomic ) UIButton *footerBtn;
18
+
17
19
@property (assign , nonatomic ) BOOL is2FAOpen;
18
20
@property (strong , nonatomic ) NSString *email, *j_captcha, *two_factor_code;
19
21
@end
@@ -39,7 +41,8 @@ - (void)viewDidLoad{
39
41
}];
40
42
tableView;
41
43
});
42
- self.navigationItem .rightBarButtonItem = [[UIBarButtonItem alloc ] initWithTitle: @" 完成" style: UIBarButtonItemStylePlain target: self action: @selector (doneBtnClicked: )];
44
+ _myTableView.tableFooterView = [self customFooterView ];
45
+ // self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"完成" style:UIBarButtonItemStylePlain target:self action:@selector(doneBtnClicked:)];
43
46
}
44
47
45
48
- (void )viewWillAppear : (BOOL )animated {
@@ -59,6 +62,20 @@ - (void)refresh2FA{
59
62
60
63
#pragma mark TableM
61
64
65
+ - (UIView *)customFooterView {
66
+ UIView *footerV = [[UIView alloc ] initWithFrame: CGRectMake (0 , 0 , kScreen_Width , 150 )];
67
+ _footerBtn = [UIButton buttonWithStyle: StrapSuccessStyle andTitle: @" 发送验证邮箱" andFrame: CGRectMake (kLoginPaddingLeftWidth , 20 , kScreen_Width -kLoginPaddingLeftWidth *2 , 45 ) target: self action: @selector (doneBtnClicked: )];
68
+ RAC (self, footerBtn.enabled ) = [RACSignal combineLatest: @[RACObserve (self , email),
69
+ RACObserve (self , j_captcha),
70
+ RACObserve (self , two_factor_code)]
71
+ reduce: ^id (NSString *email, NSString *j_captcha, NSString *two_factor_code){
72
+ return @(email.length > 0 && j_captcha.length > 0 && two_factor_code.length > 0 );
73
+ }];
74
+
75
+ [footerV addSubview: _footerBtn];
76
+ return footerV;
77
+ }
78
+
62
79
- (NSInteger )tableView : (UITableView *)tableView numberOfRowsInSection : (NSInteger )section {
63
80
return 3 ;
64
81
}
0 commit comments