How can I get notified when a UIView becomes visible?

后端 未结 4 1983
面向向阳花
面向向阳花 2021-02-02 10:47

Is there a way to get a notification, a callback or some other means to call a method whenever a UIView becomes visible for the user, i.e. when a UIScrollview is the superview o

4条回答
  •  忘掉有多难
    2021-02-02 11:17

    If your view is exhibiting behavior, it should be within a view controller. On a view controller, the viewDidAppear method will be called each time the view appears.

    - (void)viewDidAppear:(BOOL)animated
    

提交回复
热议问题