When should I call view will appear

Asked on 07/31/2024

1 search

You should call viewWillAppear during the transition phase when a view controller is about to be added to the view hierarchy and become visible. This is part of the view controller lifecycle in UIKit. Specifically, viewWillAppear is called after the view controller has been instantiated and before it is presented on the screen.

For a detailed explanation, you can refer to the session Enhance your UI animations and transitions at the timestamp 04:24.