1414
1515@interface SettingEmailViewController ()<UITableViewDataSource, UITableViewDelegate>
1616@property (strong , nonatomic ) TPKeyboardAvoidingTableView *myTableView;
17+ @property (strong , nonatomic ) UIButton *footerBtn;
18+
1719@property (assign , nonatomic ) BOOL is2FAOpen;
1820@property (strong , nonatomic ) NSString *email, *j_captcha, *two_factor_code;
1921@end
@@ -39,7 +41,8 @@ - (void)viewDidLoad{
3941 }];
4042 tableView;
4143 });
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:)];
4346}
4447
4548- (void )viewWillAppear : (BOOL )animated {
@@ -59,6 +62,20 @@ - (void)refresh2FA{
5962
6063#pragma mark TableM
6164
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+
6279- (NSInteger )tableView : (UITableView *)tableView numberOfRowsInSection : (NSInteger )section {
6380 return 3 ;
6481}
0 commit comments