iosobjective-cuiviewuikitviewwillappear

What similar functionality method (viewWillAppear) exists on UIView?


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


Solution

  • 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.