Skip to content

Instantly share code, notes, and snippets.

@kythanh
Created April 17, 2014 06:09
Show Gist options
  • Save kythanh/10956781 to your computer and use it in GitHub Desktop.
Save kythanh/10956781 to your computer and use it in GitHub Desktop.
how to remove all subviews of uiview iOS
We got serveral way to archive this:
1. [[currentView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
2. Using loop:
for(UIView *subview in [currentView subviews]) {
[subview removeFromSuperview];
}
@Sethathi
Copy link

Thanks for this tip :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment