Is there a way to set all UILabels as hidden in Objective-C? I’m showing and hiding labels based on if statements and feel like I’m writing really bulky code. Is there a way to select all UILabels to setHidden:YES a la CSS?
Edit: I need one of them visible at a time, not all hidden at once.
Thanks!
If all your labels lay at the same view you can use it’s
subviewsproperty:And if there are numerous of views with labels you can even add a category to the whole
UIView.There’s no other way to do this.
Edit: the code above updated according to your needs.