nyanev
nyanev

Reputation: 11519

Remove UIView from ViewController

I have One view controller and in this view controller I have another sub view. How can I remove this sub view. Thanks

Upvotes: 1

Views: 352

Answers (2)

PJR
PJR

Reputation: 13180

if([subview superView])
{
[subview removeFromSuperview];
}

Upvotes: 3

Mehul Mistri
Mehul Mistri

Reputation: 15147

Suppose your subview name is tempView then use this

[tempView removeFromSuperview];

Upvotes: 2

Related Questions