Your application has presented a UIAlertController of style UIAlertControllerStyleActionSheet.
提交app时,如果苹果那边是用pad测试,点到了UIAlertController,可能会报错,拒绝原因
错误提示:
Your application has presented a UIAlertController of style UIAlertControllerStyleActionSheet. The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller’s popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.
也就是说iphone有的样式,ipad不一定有。
更改方法,就是在present之前叫一个判断,做出不同样式的布局,苹果已经为我们提供好了方法
{
……
if UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.pad {
actionSheet.popoverPresentationController?.sourceView = self.view //要展示在哪里
actionSheet.popoverPresentationController?.sourceRect = self.headerV.nameLb.frame //箭头指向哪里
}
present(actionSheet, animated: true, completion: nil)
}