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);

效果如图:

iOS 宏定义UIAlertController_第1张图片

你可能感兴趣的:(iOS 宏定义UIAlertController)