How do you remove the content in a UIScrollView Programmatically? As I have to update the content in it frequently.
I don't think that there is a difference between typical UIView:
for (UIView *v in [scrollView subviews])
[v removeFromSuperView];
You can loop through your scroll view's subviews like:
for(UIView *subview in scrollView.subviews)
[subview removeFromSuperview];
or you can use - [NSArray makeObjectsPerformSelector:]
method like:
[scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With