UIAlertControllerStyleActionSheet 崩溃。

即使Devices 设置为iPhone模式,在审核时还是运行在iPad的小屏模式下。因此必须 UIActivityViewController UIAlertControllerStyleActionSheet 必须适配iPad模式

替代方案: (将ActionSheet模式更改为Alert模式, alert模式在iPhone/iPad环境下一样)

适配方案。

    UIActivityViewController *vc = nil;
    if ([[UIDevice currentDevice].model isEqualToString:@"iPad"]) {
        vc.modalPresentationStyle = UIModalPresentationPopover; //设置模态的样式
        vc.popoverPresentationController.sourceView = sourceView; //出现的在哪个Views上
    }
    [self presentViewController:vc animated:YES completion:nil];

最终的样式如图:

原文地址:https://www.cnblogs.com/jisa/p/10565914.html