ViewDidLoad vs ViewDidAppear (How to use them appropriately).

Hemant Soni
Feb 18, 2021

ViewDidLoad: This method is called after the view controller has loaded its view hierarchy into memory. This method is called regardless of whether the view hierarchy was loaded from a nib file or created programmatically in the loadView() method. You usually override this method to perform additional initialization on views that were loaded from nib files.

ViewDidAppear: Notifies the view controller that its view was added to a view hierarchy. You can override this method to perform additional tasks associated with presenting the view. If you override this method, you must call super at some point in your implementation.
Note: If a view controller is presented by a view controller inside of a popover, this method is not invoked on the presenting view controller after the presented controller is dismissed.

--

--