Created
January 23, 2021 05:52
-
-
Save KrauserHuang/b35afb5beba2e3722b48aee960728d12 to your computer and use it in GitHub Desktop.
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 characters
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