Alex Rivera | Logout

What happens when an UIView is added to another UIView twice in IOS?

Asked 2011-12-15T15:07:48.317
10

What happens when an UIView is added to another view twice in iOS? I believe it wont get added twice. Have anyone ever tried?

Edit
Report

1 Answer

20

[UIView addSubview:] documentation

Views can have only one superview. If view already has a superview and that view is not the receiver, this method removes the previous superview before making the receiver its new superview.

answered 2011-12-15T15:10:25.580

Your Answer