美文网首页
oc 封装的基本提示框

oc 封装的基本提示框

作者: 神一样的队友 | 来源:发表于2019-03-27 16:25 被阅读0次

    #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];

    }

    相关文章

      网友评论

          本文标题:oc 封装的基本提示框

          本文链接:https://www.haomeiwen.com/subject/oizzvqtx.html