I have a switch and I want to have something like this:
override func viewDidLoad() {
super.viewDidLoad()
if name.text == "Jack"{
switch.on = false
}
}
But it's not working! How can I change the state of a switch when the view controller is loading?