Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSArray *textFields = @[self.emailTextField, self.nameTextField, self.firstNameTextField ... etc];
- for (UITextField *textField in textFields) {
- textField.backgroundColor = [UIColor redColor];
- }
- @interface MyViewController : UIViewController
- @property (nonatomic, strong) IBOutletCollection(UITextField) NSArray *textFields;
- @end
- for (UITextField *textField in self.view.subviews) {
- if ([textField isKindOfClass:[UITextField class]]) {
- textField.backgroundColor = [UIColor exampleColor];
- }
- }
- NSArray *array = @[emailField, nameField, etc...]
- for (UITextField *textField in array)
- textField.backgroundColor = [UIColor exampleColor];
- }
Add Comment
Please, Sign In to add comment