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

https://github.com/dogo/SCLAlertView


iOS AlertView 超酷效果支持Block


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

另外,还支持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];



相关文章:

  • 2021-06-24
  • 2021-08-31
  • 2021-09-06
  • 2021-10-25
  • 2022-12-23
  • 2021-11-26
  • 2022-02-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-29
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案