View Callbacks

When the view hierarchy changes, callbacks can be sent to the views in question. The iOS SDK offers six callback methods. These methods may help your application keep track of views that are moving and changing parents:

Image didAddSubview:Is sent to a parent view after it has successfully added a child view via addSubview: or one of the other subview insertion methods listed earlier. It lets subclasses of UIView perform additional actions when new views are added.

Image didMoveToSuperview:Informs views that they’ve been reparented to a new ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.