Skip to content

alertController 点语法链式添加action和textField,附上block实现点语法和链式编程的基本知识和技术分享

Notifications You must be signed in to change notification settings

wode0weiyi/MethodChaining

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

MethodChaining

alertController通过点语法添加action和textField, 具体实现:

HGAlertViewController * alertVC = [HGAlertViewController alertControllerWithTitle:@"提示" message:@"选择" preferredStyle:(UIAlertControllerStyleAlert)];
    
    alertVC.addInput(@"输入账号",^(UITextField *textField){
        
        [[textField rac_textSignal] subscribeNext:^(id x) {
                NSLog(@"%@",textField.text);
        }];
    }).addAction(@"取消",^(UIAlertAction * action){
        NSLog(@"取消");
    }).addAction(@"确定",^(UIAlertAction *action){
        NSLog(@"确定");
    });
    [self presentViewController:alertVC animated:true completion:nil];

block链式编程基本语法和技术分享

有问题欢迎咨询

About

alertController 点语法链式添加action和textField,附上block实现点语法和链式编程的基本知识和技术分享

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published