Skip to content

Instantly share code, notes, and snippets.

@JeremyXue77
Created April 13, 2019 23:25
Show Gist options
  • Select an option

  • Save JeremyXue77/dcf3a350150d0be15d8fb7137200788f to your computer and use it in GitHub Desktop.

Select an option

Save JeremyXue77/dcf3a350150d0be15d8fb7137200788f to your computer and use it in GitHub Desktop.
@IBAction func changeRows(_ sender: UIStepper) {
let alert = UIAlertController(title: "", message: "Your password will be cleared. Do you want to continue?", preferredStyle: .alert)
let continueAction = UIAlertAction(title: "Continue", style: .default) { [weak self](_) in
self?.row = Int(sender.value)
self?.password = []
self?.gestureCollectionView.reloadSections(IndexSet(integer: 0))
}
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
alert.addAction(continueAction)
alert.addAction(cancelAction)
self.present(alert, animated: true, completion: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment