I have two views, viewA and viewB. I load viewB on top of viewA with
[self.view addSubview: viewB.view];
I wan't to remove viewB, but I don't how to do it. I tried
[self.view removeFromSuperview];
but this isn't working. How can I do this?
Call -removeFromSuperview
on viewB.view
.
To remove viewB's view from its superview, you need to call removeFromSuperview on that view.
[viewB.view removeFromSuperview];
From the UIView class reference.
removeFromSuperview
Unlinks the receiver from its superview and its window, and removes it from the responder chain.
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