iOS UIAlertControllerDemo
- (void)checkUpdatesAction {
#define kCheckUpdatesActionDownloadTitle @"检查更新"
#define kCheckUpdatesActionDownloadSubtitle @"点击确定进行下载更新,点击取消取消下载"
UIAlertController *alert = [UIAlertController alertControllerWithTitle:kCheckUpdatesActionDownloadTitle message:kCheckUpdatesActionDownloadSubtitle preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *actionSure = [UIAlertAction actionWithTitle:@"下载" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"checkUpdatesAction:下载");
}];
UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"checkUpdatesAction:取消");
}];
[alert addAction:actionCancel];
[alert addAction:actionSure];
[self presentViewController:alert animated:YES completion:nil];
}
IMG_0033.PNG
本文标题:iOS UIAlertControllerDemo
本文链接:https://www.haomeiwen.com/subject/wpssbttx.html
网友评论