does viewDidLoad get called after a popViewControl

2019-07-16 06:03发布

问题:

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

回答1:

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.