This method is only called once when during the life cycle of the view controller object. This function is a great place for the initial setup of objects the view controller needs.
viewWillAppear
This method is called just before the view appears on the screen. This function is a great place for showing or hiding items on the screen or any operations that need to happen every time before the view is visible.
viewDidAppear
This method is called right after the view appears to the user. This function is a great place for starting any animations.
viewWillDisappear
This method is called before the view is actually removed and before any animations are configured.
viewDidDisappear
This method is called once the view has been removed from a view hierarchy. You can use this method for any cleanup that is required.
This diagram illustrates the UIViewController Lifecycle of a simple 2 screen app.
No comments:
Post a Comment