Search code examples
iosobjective-cswiftuiapplicationdelegate

iOS - Previous screen flashing when coming from background


This is my situation: I push a ViewController that is in landscape mode, then go to the home screen. When I go back in the app, the previous views in the back stack flash for just a moment before going to my ViewController. This doesn't happen for portrait ViewControllers.

Has anyone seen this before or know of a workaround? Thanks!

For the record, I am simply pushing the ViewController via:

self.navigationController!.pushViewController(viewController, animated: true);

and then forcing the view into landscape mode, not sure if that's relevant.


Solution

  • What solved this problem for me was calling

    window?.makeKeyAndVisible();
    

    in the AppDelegate file