How to add an action to a UIAlertView button using Swift iOS
I want to add another button other than the "OK" button which should just dismiss the alert. I want the other button to call a certain function. var logInErrorAlert: UIAlertView = UIAlertView() logInErrorAlert.title = "Ooops" logInErrorAlert.message = "Unable to log in." logInErrorAlert.addButtonWithTitle("Ok") How do I add another button to this alert, and then allow it to call a function once clicks so lets say we want the new button to call: retry() Jake The Swifty way is to use the new UIAlertController and closures: // Create the alert controller let alertController = UIAlertController