#pragma mark 提示框
-(void)addActionTotitle:(NSString*)title withMessage:(NSString*)massage withActionTitle:(NSString*)actionTitle withActionTitle:(NSString*)actionTitle2 preferredStyle:(UIAlertControllerStyle)preferredStyle viewController:(UIViewController*)vc block:(void(^)(BOOLisdelea))isok{
UIAlertController*alertController=[UIAlertControlleralertControllerWithTitle:titlemessage:massage preferredStyle:(preferredStyle)];
UIAlertAction *action=[UIAlertAction actionWithTitle:actionTitle style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
isok(YES);
}];
UIAlertAction *action2=[UIAlertAction actionWithTitle:actionTitle2 style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
}];
[alertControlleraddAction:action];
if(![actionTitle2isEqualToString:@""]) {
[alertControlleraddAction:action2];
}
[vcpresentViewController:alertController animated:YES completion:nil];
}
网友评论