Skip to content

Instantly share code, notes, and snippets.

@0ber
Last active September 5, 2016 19:21
Show Gist options
  • Save 0ber/0cd49dcfc0b5d73e84007e6290786065 to your computer and use it in GitHub Desktop.
Save 0ber/0cd49dcfc0b5d73e84007e6290786065 to your computer and use it in GitHub Desktop.
example to create actionSheet
let actionSheet = UIAlertController(title: "title", message: "message", preferredStyle: .ActionSheet)
let action = UIAlertAction(title: "default", style: .Default, handler: {_ in print("tap")})
let cancel = UIAlertAction(title: "cancel", style: .Cancel, handler: {_ in print("tap")})
let destructive = UIAlertAction(title: "action", style: .Destructive, handler: {_ in print("tap")})
actionSheet.addAction(action)
actionSheet.addAction(cancel)
actionSheet.addAction(destructive)
presentViewController(alert, animated:true, completion:nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment