iOS 宏定义UIAlertController

#define showMessage(TITLE,MESSAGE,QUVC) UIAlertController *alertController = [UIAlertController alertControllerWithTitle:TITLE message:MESSAGE preferredStyle:UIAlertControllerStyleAlert];\

[alertController addAction:[UIAlertAction actionWithTitle:@"确定"style:UIAlertActionStyleDefault handler:nil]];\

[QUVC presentViewController:alertController animated:YES completion:nil];



TITLE:提示框的title,

MESSAGE:提示框要显示的内容,

QUVC:UIAlertController所在的UIViewController,调用时用self即可.

应用时:

showMessage(@"联系电话",@"0371-66666666/88888888",self);

效果如图:

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容