So Im very new to coding, but I'm trying to make a simple text field where you can enter password, and if that password/string is equal to the password I have set, it will do a action.. here is what I have so far, but it dose not work
@IBOutlet weak var KodeText: UITextField!
@IBOutlet weak var enterknapp: UIButton!
var password = "123"
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
enterknapp.isEnabled = false
if password == KodeText.text { enterknapp.isEnabled = true
}
}