Skip to content

Instantly share code, notes, and snippets.

@0ber
Last active September 5, 2016 19:41
Show Gist options
  • Save 0ber/40cd265d0edf9e096a3a7ea0163d8441 to your computer and use it in GitHub Desktop.
Save 0ber/40cd265d0edf9e096a3a7ea0163d8441 to your computer and use it in GitHub Desktop.
extension SwiftyActions {
var action: UIAlertAction {
switch self {
case .Default(let title, let handler): return UIAlertAction(title: title, style: .Default, handler: handler)
case .Cancel(let title, let handler): return UIAlertAction(title: title, style: .Cancel, handler: handler)
case .Destructive(let title, let handler): return UIAlertAction(title: title, style: .Destructive, handler: handler)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment