I am using 2 UIView to draw different objects in an xib file. You need to clear the view before drawing new objects for some actions. Initially, when the types of objects are smaller in number, I used this:
for (UILabel *btn in self.contentView.subviews) { if([btn isKindOfClass:[UILabel class]]) { [btn removeFromSuperview]; } }
But when I have several actions and objects of several types that need to be drawn for each action, it does not code well using this type of method. Is there an effective method for doing this?
source share