Подскажите пожалуйста? можно ли как-нибудь заставить работать AlertController(.actionSheet) на iPad?
AlertController(.actionSheet) и iPad
devlab
#2
let actionSheetController: UIAlertController = UIAlertController(title: "SomeTitle", message: nil, preferredStyle: .actionSheet)
let editAction: UIAlertAction = UIAlertAction(title: "Edit Details", style: .default) { action -> Void in
print("Edit Details")
}
let deleteAction: UIAlertAction = UIAlertAction(title: "Delete Item", style: .default) { action -> Void in
print("Delete Item")
}
let cancelAction: UIAlertAction = UIAlertAction(title: "Cancel", style: .cancel) { action -> Void in }
actionSheetController.addAction(editAction)
actionSheetController.addAction(deleteAction)
actionSheetController.addAction(cancelAction)
actionSheetController.popoverPresentationController?.sourceView = yourSourceViewName
present(actionSheetController, animated: true) {
print("option menu presented")
}