Skip to content

Instantly share code, notes, and snippets.

@KrauserHuang
Created January 23, 2021 05:52
Show Gist options
  • Save KrauserHuang/b35afb5beba2e3722b48aee960728d12 to your computer and use it in GitHub Desktop.
Save KrauserHuang/b35afb5beba2e3722b48aee960728d12 to your computer and use it in GitHub Desktop.
func checkPassword() {
if typePassword == correctPassword {
let controller = UIAlertController(title: "Correct", message: "Welcome back!", preferredStyle: .alert)
let action = UIAlertAction(title: "OK", style: .default) { (_) in
self.reset()
}
controller.addAction(action)
present(controller, animated: true, completion: nil)
} else {
let controller = UIAlertController(title: "Wrong", message: "Please try again!", preferredStyle: .alert)
let action = UIAlertAction(title: "OK", style: .cancel, handler: nil)
controller.addAction(action)
present(controller, animated: true, completion: reset)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment