Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between addSubview and insertSubview in UIView class

What is the difference between addSubview and insertSubView methods when a view is added programmatically?

like image 953
Ashwani K Avatar asked Oct 05 '09 09:10

Ashwani K


1 Answers

The only difference is in where the view is added: whether it is the frontmost view (addSubview:), or it is before the 5th subview, (insertSubview:atIndex:) or if it is immediately behind another subview (insertSubview:aboveSubview:).

like image 128
mahboudz Avatar answered Oct 02 '22 20:10

mahboudz