What similar functionality method (viewWillAppear) exists on UIView?

Centurion picture Centurion · May 2, 2012 · Viewed 19.1k times · Source

viewWillAppear is called on UIViewController when a view is about to be shown on screen. Is it possible to get similar callback on UIView?

Answer

Paul.s picture Paul.s · May 2, 2012

How about the following from the UIView reference

willMoveToSuperview:, didMoveToSuperview - Implement these methods as needed to track the movement of the current view in your view hierarchy.

this will at least tell you when it is added to a view hierarchy but there is no guarantee that the view hierarchy is presented/viewable.