sceneDidLoad being called twice? sceneDidLoad being called twice? xcode xcode

sceneDidLoad being called twice?


Normally, sceneDidLoad is only called one time. However, if a memory warning is sent then UIViewController releases its scene and sets it to nil if the view controller isn't visible. The next time that the scene appears the view controller will reload the scene and call sceneDidLoad again.

You have to assume that sceneDidLoad can be called multiple times.

Implement didReceiveMemoryWarning and log or set a breakpoint to see what is happening.