Question

Does viewDidLoad get called when you're popping back to a UIView?

Was it helpful?

Solution

viewDidLoad gets called whenever loadView is called. loadView is called whenever the view is requested from a UIViewController and it is currently nil.

If you pop to a UIViewController and the view property is nil, loadView and hence viewDidLoad will be called. The view could be nil if it was never loaded or if it was unloaded while another view controller was on screen. It might never have been loaded if several view controllers were pushed at once.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top