iOS

iOS UIAlertControllerDemo

2017-01-13  本文已影响15人  NieFeng1024
- (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
上一篇 下一篇

猜你喜欢

热点阅读