Wednesday, 20 February 2013

To remove subviews excepting other views.


for (UIView *view in self.contentView.subviews) {
        if (![view isKindOfClass:[UIButton class]] && ![view isKindOfClass:[UILabel class]]) {
            [view removeFromSuperview];
        }
    }