Skip to content

Instantly share code, notes, and snippets.

@kennylugo
Created February 20, 2016 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennylugo/e18422437501090bcb67 to your computer and use it in GitHub Desktop.
Save kennylugo/e18422437501090bcb67 to your computer and use it in GitHub Desktop.
TableCellSelection & UIAlertController
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
//create option menu
let optionMenu = UIAlertController(title: "Option Menu", message: "Select one", preferredStyle: .ActionSheet)
//create action
let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler: nil)
//add action to menu
optionMenu.addAction(cancelAction)
//present menu contorller
self.presentViewController(optionMenu, animated: true, completion: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment