测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
发布最新发布 | 2016年8月 |
由 Mango fever 维护。
UIAlertView 分类用于块表达式
UIAlertView *alertView = [UIAlertView alertViewWithTitle:@"title" message:@"message"];
[alertView addButtonWithTitle:@"OK" actionBlock:^(UIAlertView *alertView, NSInteger buttonIndex) {
// do something for OK
}];
[alertView addCancelButtonWithTitle:@"Cancel" actionBlock:^(UIAlertView *alertView, NSInteger buttonIndex) {
// do something for cancel
}];
[alertView show];
[UIAlertView showWithTitle:@"Title" message:@"message" cancelButtonTitle:@"cancel" action:^{
NSLog(@"cancel");
}];
[UIAlertView showWithTitle:@"Title" message:@"message" cancelButtonTitle:@"cancel" cancelAction:^{
NSLog(@"cancel");
} otherButtonTitle:@"OK" otherButtonAction:^{
NSLog(@"ok");
}];