xcode enable a button after a text field is filled
@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
}
Also in Swift:
- swift change navigation bar color
- convert string to base64 swift
- swift xcode debug cannot see code backtrace
- swift
- swiftui foreach
- swift change background color
- swift convert decimal to string
- go to view controller programmatically swift
- swift animate a label ishidden
- xcode enable a button after a text field is filled
- swift how to wait in a loop
- button image not working swiftui
- swift toggle on change
- rtl ios swift
- how to set the center in view in swift
- check when webview finish loading swift
- get device height spritekit
- Make a VStack fill the width of the screen in SwiftUI
- swift get slected row data in tableview cell
- add to beginning of array swift
- swipe right to delete swiftui
- rounded ios button
- swift pop to specific view controller
- how to set the font of text in swiftui