read
Asume that our view name is scrollview
<h3>First way</h3><pre style="background-color: #f0f0f0; border: 1px dashed rgb(204, 204, 204); font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; width: 646.4666748046875px;"> [[scrollview subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
</pre><h3>Second way</h3><pre style="background-color: #f0f0f0; border: 1px dashed rgb(204, 204, 204); font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; width: 646.4666748046875px;">NSArray* subviews = scroll.subviews;
</pre>
for (UIView* view in subviews) {
[view removeFromSuperview];
}
Source 1
Source 2