Im trying to show a UIAlertView in my swift App
alert = UIAlertView(title: \"\",
message: \"bla\",
delegate: self,
cancelButtonTitle:
var alert = UIAlertController(title: "Alert", message: "Message", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)
To handle actions:
alert.addAction(UIAlertAction(title: "Ok", style: .Default, handler: {
action in switch action.style {
case .Default:
println("default")
case .Cancel:
println("cancel")
case .Destructive:
println("destructive")
}
}))