I created an action sheet, but the problem is that the delegate method is not called
myActionSheet = UIActionSheet()
myActionSheet.addButtonWithTitle(\"
UIActionSheet
is deprecated since iOS8, I would recommend using UIAlertController
if you don't have to support version below:
private func presentSettingsActionSheet() {
let settingsActionSheet: UIAlertController = UIAlertController(title:nil, message:nil, preferredStyle:UIAlertControllerStyle.ActionSheet)
settingsActionSheet.addAction(UIAlertAction(title:"Send Feedback", style:UIAlertActionStyle.Default, handler:{ action in
self.presentFeedbackForm()
}))
settingsActionSheet.addAction(UIAlertAction(title:"Tell Me a Joke!", style:UIAlertActionStyle.Default, handler:{ action in
self.presentRandomJoke()
}))
settingsActionSheet.addAction(UIAlertAction(title:"Cancel", style:UIAlertActionStyle.Cancel, handler:nil))
presentViewController(settingsActionSheet, animated:true, completion:nil)
}
Here is what it looks like presented: