Last active
December 11, 2017 23:39
-
-
Save jasonhilimire/c0dff5e1fcef4dabc7ba1b0ab3d19331 to your computer and use it in GitHub Desktop.
Revisions
-
jasonhilimire revised this gist
Dec 11, 2017 . No changes.There are no files selected for viewing
-
jasonhilimire revised this gist
Dec 11, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,12 @@ let alertController = UIAlertController(title: "Warning!", message: "This will do some crazy stuff! This cannot be undone", preferredStyle: .alert) let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { action in print("Cancel button pressed") } alertController.addAction(cancelAction) // maybe some stuff let deleteAction = UIAlertAction(title: "Delete", style: .destructive) { action in // .destructive = RED text, .default = blue text // some stuff // probably need this if using in a tableView self.tableView.reloadData() print("Delete button pressed") -
jasonhilimire created this gist
Dec 11, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ let alertController = UIAlertController(title: "Warning!", message: "This will DELETE all your Shot Cycles data!! This cannot be undone", preferredStyle: .alert) let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { action in print("Cancel button pressed") } alertController.addAction(cancelAction) // maybe some stuff let deleteAction = UIAlertAction(title: "Delete", style: .destructive) { action in // some stuff // probably need this if using in a tableView self.tableView.reloadData() print("Delete button pressed") } alertController.addAction(deleteAction) self.present(alertController, animated: true) { // ... }