I keep getting this error:
Implicit use of 'self' in closure; use 'self.' to make capture semantics explicit
even though I put the self in the code. Please correct me.
Here is my code:
@IBAction func doneButton(_ sender: Any) {
let code = codeTextField.text
if code == "TEST" || code == "Test" || code == "test" {
var myAlert = UIAlertController(title:"Alert", message: "You are logging into The Test Zoo, right?", preferredStyle: UIAlertController.Style.alert)
let yesAction = UIAlertAction(title: "Yes", style: UIAlertAction.Style.default) {
UIAlertAction in
performSegue(withIdentifier: "welcomeButton", sender:self)
}
There is more, but the yesAction needs correction.
performSegue
is a method, which you're implicitly calling on self
; the explicit version would be self.performSegue(...)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With