Add same subview multiple times to view Add same subview multiple times to view ios ios

Add same subview multiple times to view


A view can only be contained in a single parent view's hierarchy. As soon as you add it to a new one, it is removed from the previous one. In this case, it is being removed and added back to the same view's hierarchy. You would need to make a copy of the sub-view to have it appear multiple times.