UIAlertController *alert = [UIAlertController alertControllerWithTitle:self.textLabel.text message:self.detailTextLabel.text preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *alertAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"关了");
}];
[alertaddAction:alertAction];
[[[[UIApplication sharedApplication] keyWindow] rootViewController] presentViewController:alert animated:YES completion:^{
NSLog(@"弹出来了");
}];
网友评论