Xcode Enable A Button After A Text Field Is Filled

[Solved] Xcode Enable A Button After A Text Field Is Filled | Swift - Code Explorer | yomemimo.com
Question : xcode enable a button after a text field is filled

Answered by : kristopher-wrobel

@objc func editingChanged(_ textField: UITextField) { if textField.text?.characters.count == 1 { if textField.text?.characters.first == " " { textField.text = "" return } } guard let habit = habitNameField.text, !habit.isEmpty, let goal = goalField.text, !goal.isEmpty, let frequency = frequencyField.text, !frequency.isEmpty else { doneBarButton.isEnabled = false return } doneBarButton.isEnabled = true
}

Source : https://stackoverflow.com/questions/34941069/enable-a-button-in-swift-only-if-all-text-fields-have-been-filled-out | Last Update : Tue, 08 Sep 20

Answers related to xcode enable a button after a text field is filled

Code Explorer Popular Question For Swift