Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

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
}
Comment

PREVIOUS NEXT
Code Example
Swift :: How to make dart typing stricter 
Swift :: where to save audio asset swift 
Swift :: Swift String Example 
Swift :: get device height spritekit 
Swift :: load plist swift 
Swift :: swiftui lowercase 
Swift :: swift hashable 
Swift :: move to nect cell of collection after some time automatically in ios swift 
Ruby :: ruby delete file 
Ruby :: rails skip authenticity token 
Ruby :: rails image tag 
Ruby :: dotenv-rails comments 
Ruby :: rake db:rollback not doing anything 
Ruby :: rails link_to class 
Ruby :: ruby read file 
Ruby :: head in rails 
Ruby :: rails string to date 
Ruby :: how to destroy a migration in rails 
Ruby :: array string ruby 
Ruby :: ruby generate uuid 
Ruby :: attr_accessor ruby 
Ruby :: link to do rails 
Ruby :: %w meaning in ruby 
Ruby :: insert element in array ruby 
Ruby :: dynamic database connection in rails 
Ruby :: ruby hash print 
Ruby :: rails g controller with actions 
Ruby :: add elements to ruby hashes 
Ruby :: ruby nth element of array 
Ruby :: is identation madatory in ruby 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =