iOS自定义alertView提示框实例分享

2020-01-15 14:06:57于海丽

在需要调用的地方进行调用


//
// ViewController.m
// PBAlertDemo
//
// Created by 裴波波 on 16/4/20.
// Copyright © 2016年 裴波波. All rights reserved.
//

#import "ViewController.h"
#import "PBAlertController.h"
@interface ViewController ()

@end

@implementation ViewController

//点击按钮弹出提示框
- (IBAction)clickShowAlertBtn:(id)sender {
 
 PBAlertController * alertVc = [PBAlertController shareAlertController];
 alertVc.messageColor = [UIColor redColor];
 [alertVc alertViewControllerWithMessage:@"这是一message沙哈" andBlock:^{
  NSLog(@"点击确定后执行的方法");
 }];
 alertVc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
 [self presentModalViewController:alertVc animated:YES];
}

@end

以上就是本文的全部内容,希望对大家学习iOS程序设计有所帮助。



注:相关教程知识阅读请移步到IOS开发频道。