viewWillAppear is called on UIViewController when a view is about to be shown on screen. Is it possible to get similar callback on UIView?
Notifies the view controller that its view is about to be added to a view hierarchy.
viewDidAppear is called once you see the loaded view on screen. It is called after view appeared. ViewDidAppear is called everytime when you see the view after it is loaded.
Show activity on this post. Difference between "will" and "did"... As the name suggests the viewWillAppear is called before the view is about to appear and viewDidAppear is called when view did appear.
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.
No, but you can forward that notification to the desired view from your view controller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With