ios---UIAlertController简单应用

UIAlertController应用

 UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"保存" message:@"是否保存图片?" preferredStyle:UIAlertControllerStyleActionSheet];
    
    UIAlertAction *action = [UIAlertAction actionWithTitle:@"保存" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        [self saveImage];
    }];
    UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
        
    }];
    [alertController addAction:action];
    [alertController addAction:action2];
    [self presentViewController:alertController animated:YES completion:nil];

你可能感兴趣的:(ios---UIAlertController简单应用)