remove UIView from superView

ios, iphone, uiview

Solution

UIView---->UIView1------>UIView2

Suppose you want to remove UIView2 on UIView1, just you can write like

[UIView2 removeFromSuperView].

Suppose you want to remove UIView1 on UIView, just you can write like

`[UIView1 removeFromSuperView].`

In this situation, UIView2 is also removed. Because when you remove any view, all subviews of view will be removed.

Problem

I have two UIViews, UIView1 and UIView2. UIView2 is being added as a subview to UIView1, what I would like to know is that if I call ``` [UIView1 removeFromSuperview]; ``` dose that also apply the removeFromSuperView on UIView2? or do I specifically have to call that on the UIView2 as well... any help would be appreciated

Original source