class Form {
@IBOutlet var fieldsToClear: [UITextField]! //Outlet collection of 20 textfields of the form screen
var allFieldsAreEmpty : Bool = false // variable to change when ever any of the textfield changes
}
I have 20 textfields in a view controller.I have created an outletCollection for all the textfields. I want to know whether it's possible to observe all textfields and check whether any of them are empty or not and so on without using any event outlet for all the textfields one by one which could make the view controller messy.
All i want is to check all textfields and change the allFieldsAreEmpty variables accordingly.