I am wondering how to significantly convert the objective c code below to swift.
This will go through all the child objects in my desired view, check to see if they are text fields, and then check to see if they are empty.
for (UIView *view in contentVw.subviews) { NSLog(@"%@", view); if ([view isKindOfClass:[UITextField class]]) { UITextField *textfield = (UITextField *)view; if (([textfield.text isEqualToString:""])) {
This is where I am with quick translation:
for view in self.view.subviews as [UIView] { if view.isKindOfClass(UITextField) {
Any help would be great!
ios for-loop swift fast-enumeration
Ryan Aug 02 '14 at 18:06 2014-08-02 18:06
source share