iOS UIAlertController的简单使用
作者:
隔墙送来秋千影 | 来源:发表于
2018-05-17 17:59 被阅读32次UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"现有新版本app" message:@"请下载新版本后继续使用" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"去下载" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSString *appStr = @"https://itunes.apple.com/cn/app/id1234567890?mt=8";
NSString *version = [UIDevice currentDevice].systemVersion;
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:appStr] options:@{UIApplicationOpenURLOptionUniversalLinksOnly:@""}
completionHandler:nil];
}];
UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
}];
[alert addAction:action1];
[alert addAction:action2];
[self presentViewController:alert animated:YES completion:nil];
本文标题:iOS UIAlertController的简单使用
本文链接:https://www.haomeiwen.com/subject/qhlidftx.html
网友评论