removeFromSuperView() removes all of its subviews

Yes. Basically, that is what a subview is. What you do to a superview, qua view, you do its subviews. Move it, hide it, show it, transform it, change its alpha, whatever.

Another way to think about it: what does it mean for a subview to have no superview in the interface? It means the subview is not in the interface. Well, you just took the superview out of the interface.

And we can go further. The superview owns the subview. If you remove the superview, by default, it is destroyed. In that case, the subview is destroyed too; it has no owner any more.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top