When discovering the protocols of a view controller you have created, you get to see the Recommended functions that we offer the user. The purpose of this article, is that by the end of it, you will be able to understand and use each one of them. 

Before we list the recommended functions, we would like to explain the procedure of presenting a view controller. When a view controller - screen appears on the app, its view enters a view hierarchy. In the same note, when a screen is dismissed, its view is removed from the view hierarchy. Now that this is clear, let's get started!

  • viewDidAppear: automatically called after the specific view controller has been presented.
  • viewDidDisappear: automatically called after the specific view controller's view has been removed from the view hierarchy.
  • viewDidLayoutSubviews: automatically called to notify the view controller that its view has just laid out its subviews.
  • viewDidLoad: automatically called after the controller'��s view is loaded into memory.
  • viewWillAppear: automatically called when the view controller's view is about to be added to a view hierarchy.
  • viewWillDisappear: automatically called when the view controller's view is about to be removed to a view hierarchy.
  • viewWillLayoutSubviews: automatically called to notify the view controller that its view is about to layout its subviews.

Did this answer your question?