Hi i'm new with Swift programming. What im trying to do is Disable my button (signIn) in viewDidLoad and only enable when the textfields have text in them. Here's what i've achieved so far. (not much though!)
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
signIn.isEnabled = false
// Do any additional setup after loading the view, typically from a nib.
}
@IBOutlet weak var emailtxt: UITextField!
@IBOutlet weak var passwordtxt: UITextField!
@IBOutlet weak var signIn: UIButton!
I need help to create a function in signIn that keeps button disabled until text fields (emailtxt & passwordtxt) have text in them and then proceed.
Glad if anyone can sort me. Thanks in advance!
ViewController
, and in this function check if all input texts aren't equalsnil
Outlets
at the begining of theViewController
?