The easiest way is to give your tag a barviewspecial tag:
barview.tag = 123221;
and then check the box
UIView* barview = [cell viewWithTag:123221];
if (barview != nil) {
...
}
Otherwise, you need to iterate through the array .subviewsand check if the property matches, e.g.
UIView* barview = nil;
for (UIView* subview in cell.subviews) {
if ([subview isKindOfClass:[BarView class]]) {
barview = subview;
break;
}
}
if (barview != nil) {
...
}
source
share