-4
@IBOutlet weak var button: NSButton!
@IBOutlet weak var password: NSSecureTextField!
@IBAction func buttonclick(_ sender: Any) {
   if(password.text == "test"){

   }
}

this said it didn't work or something now I want it to check if the password is like test and then it enters but now i tried to do it like the normal text box but it wouldn't work ether

Yevhen Dubinin
  • 4,657
  • 3
  • 34
  • 57
D.D.Jong
  • 1
  • 4

1 Answers1

1

Replace with

if password.stringValue == "test" {
        print("correct")
    }
Rahul Dasgupta
  • 894
  • 6
  • 18