The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller's popoverPresentationController
iPhone和iPad使用UIAlertController展示ActionSheep時(shí)棋返,展示是不一樣的曲稼。
所以在iPhone上正常顯示的AlertController渠羞,在iPad上顯示要添加幾行代碼
let popover = alertVc.popoverPresentationController
if (popover != nil) {
popover?.sourceView = sender
popover?.sourceRect = sender.bounds
popover?.permittedArrowDirections = .any
}