currently i\'m running into big trouble with my ActionSheet. On iPhone it works great, but on iPad it only crashes
I create a new project with only one button
<
Nate Cook is totally right however I would do it so I detect if it is iPad or iPhone.
This is for barButtonItem:
if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.pad ){
if let currentPopoverpresentioncontroller = alertController.popoverPresentationController{
currentPopoverpresentioncontroller.barButtonItem = sender as! UIBarButtonItem
currentPopoverpresentioncontroller.permittedArrowDirections = UIPopoverArrowDirection.down;
self.present(alertController, animated: true, completion: nil)
}
}else{
self.present(alertController, animated: true, completion: nil)
}