美文网首页iOS
iOS UIAlertControllerDemo

iOS UIAlertControllerDemo

作者: NieFeng1024 | 来源:发表于2017-01-13 15:57 被阅读15次
- (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