I have a view hierarchy that I need to remove entirely. Is it okay to just call removeFromSuperview
on the top parent view or do I need to visit each child node recursively and remove it individually?
Edit: Just to clarify, I understand that removing the parent physically removes the children from view, but does that also decrease their ref-counts appropriately?
If the view's superview is not nil , the superview releases the view. Calling this method removes any constraints that refer to the view you are removing, or that refer to any view in the subtree of the view you are removing.
All subviews belong to the view; so, when you remove a view from it's superview - it is removed with all it's subviews.
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