I have a method that adds some subviews (images/buttons) to my ScrollView.
The thing is that from outside of the ScrollView the user can tap a button that will chang
Here is what I did to remove all subview except scrollbar, I removed all subviews that have frame.size.width greater than 10, scrollbar width is smaller than 10, so it will not be removed. This assumes that all the views that you add to UIScollView have a width greater than 10.
for (UIView * view in view.subviews) {
if(view.frame.size.width > 10){ // removes all component except scrollbar
[view removeFromSuperview];
}
}