I have an odd bug. Whenever I run my app from Xcode, the order of sceneDelegate calls and view controller view lifecycle calls is different.
When I run the app from Xcode I get what I thought was the standard lifecycle order of calls: 2022-02-25 12:10:04.9980 viewWillAppear() 2022-02-25 12:10:05.0380 In sceneWillEnterForeground 2022-02-25 12:10:05.0390 In sceneDidBecomeActive() 2022-02-25 12:10:05.0410 viewDidAppear()
But, if I take the same Xcode debug build and run it on my iPhone the view controller's viewDidAppear() is called before sceneDidBecomeActive():
2022-02-25 12:08:43.8740 viewWillAppear() 2022-02-25 12:08:43.8790 In sceneWillEnterForeground **2022-02-25 12:08:43.8810 viewDidAppear() ** 2022-02-25 12:08:44.1690 In sceneDidBecomeActive()
This happens every time. The issue I have is that since I spend most of my time in Xcode, I assumed that the order I was getting was always the same, so my code depends on that.
Why does this happen and is there a way of guaranteeing that the root controller's viewDidAppear() is called after sceneDidBecomeActive()
Thanks