Site icon CodeWithSwift

View Controller Life Cycle

View Controller Life Cycle Methods

init(coder)/init(nibName:bundle:):

Called when the view controller is created programmatically or via Storyboard.

loadView()

Creates the view for the view controller (usually overridden if creating views manually).

viewDidLoad()

Called once when the view is loaded into memory.

viewWillAppear()

Called before the view appears on the screen

viewDidAppear()

Called after the view appears.

viewWillDisappear()

Called before the view is removed.

viewDidDisappear()

Called after the view disappears.

deinit

Called when the view controller is removed from memory.

Exit mobile version