iOS AlertView 超酷效果支持Block

UIAlertView大家可能经常用到,但是UIAlertView 没有block功能,的确不方便。故而找到了这个开源项目,

https://github.com/dogo/SCLAlertView


iOS AlertView 超酷效果支持Block_第1张图片


界面比较酷,不说还支持很多高级功能。

另外,还支持pod,岂不更方便

pod 'SCLAlertView-Objective-C'


SCLAlertView *alert = [[SCLAlertView alloc] init];

//Using Selector

[alert addButton:@"First Button" target:self selector:@selector(firstButton)];

//Using Block

[alert addButton:@"Second Button" actionBlock:^(void) {

NSLog(@"Second button tapped");

}];

//Using Blocks With Validation

[alert addButton:@"Validate" validationBlock:^BOOL {

BOOL passedValidation = ....

return passedValidation;

} actionBlock:^{

// handle successful validation here

}];

[alert showSuccess:self title:@"Button View" subTitle:@"This alert view has buttons" closeButtonTitle:@"Done" duration:0.0f];



你可能感兴趣的:(iOS AlertView 超酷效果支持Block)