Skip to content

Instantly share code, notes, and snippets.

@edwardean
Created December 17, 2015 09:04
Show Gist options
  • Save edwardean/c740872b5b2472358311 to your computer and use it in GitHub Desktop.
Save edwardean/c740872b5b2472358311 to your computer and use it in GitHub Desktop.
Mac OS:
[someNSView setSubviews:[NSArray array]];
For UIView (iOS development only), you can safely use makeObjectsPerformSelector:
because the subviews property will return a copy of the array of subviews:
iOS:
[[someUIView subviews]
makeObjectsPerformSelector:@selector(removeFromSuperview)];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment