Skip to content

Instantly share code, notes, and snippets.

@jasonhilimire
Last active December 11, 2017 23:39
Show Gist options
  • Select an option

  • Save jasonhilimire/c0dff5e1fcef4dabc7ba1b0ab3d19331 to your computer and use it in GitHub Desktop.

Select an option

Save jasonhilimire/c0dff5e1fcef4dabc7ba1b0ab3d19331 to your computer and use it in GitHub Desktop.

Revisions

  1. jasonhilimire revised this gist Dec 11, 2017. No changes.
  2. jasonhilimire revised this gist Dec 11, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion UIAlertController
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,12 @@
    let alertController = UIAlertController(title: "Warning!", message: "This will DELETE all your Shot Cycles data!! This cannot be undone", preferredStyle: .alert)
    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")
  3. jasonhilimire created this gist Dec 11, 2017.
    19 changes: 19 additions & 0 deletions UIAlertController
    Original 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) {
    // ...
    }