Difference between addSubview and insertSubview in UIView class

Ashwani K picture Ashwani K · Oct 5, 2009 · Viewed 61k times · Source

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

Answer

mahboudz picture mahboudz · Oct 5, 2009

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:).