UIAlertController 使用

        UIAlertController  *alertVC = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet] ;

        

        [alertVC addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *  action) {

                NSLog(@"点击 取消 ");

        }]];

        

        [alertVC addAction:[UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *  action) {

            NSLog(@"拍照 ");

            [weakself loadPictureFromCarmeral];

        }]];

        

        [alertVC addAction:[UIAlertAction actionWithTitle:@"从手机相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction *  action) {

            NSLog(@"点击 从手机相册选择 ");

            

            [weakself  getImageFromAlbum];

            

        }]];

        [self presentViewController:alertVC animated:YES completion:nil];

 
原文地址:https://www.cnblogs.com/iOS-mt/p/5482073.html