0

I am doing a simple pushViewController(controller, animated: true) on my view controller on iPad:

I am starting on ViewController A. I want to push viewController B on a button tap.

I have a func buttonTapped( { rootViewController.pushViewController(controller, animated: true) that is getting called properly on button tap.

When this push gets called, the screen does indeed push in a new controller, but for a couple of frames (maybe 1-2 seconds max), I can see part of viewController A "embedded behind" viewController B, before A fully disappears.

Why is this happening? On iPhone it does not have this issue.

Thanks!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Logan
  • 1,172
  • 9
  • 23
  • You need to show more code and/or setup of what you currently have as there are many reasons that could cause this. – Upholder Of Truth Jan 08 '18 at 22:01
  • I'm not sure how much more to show here, it's really just a simple button tap into another view controller. What other code would be helpful to see? – Logan Jan 08 '18 at 22:03
  • See if that code outside main thread?? – Shehata Gamal Jan 08 '18 at 22:05
  • How are the view controllers setup. I.e is something in one of them causing the delay. Are you perhaps doing something really time intensive in one of the methods such as viewDidLoad. How is controller created in the before you push it. What is rootViewController that it has a pushViewController method (i.e. is it a UINavigationController). It's difficult to say what a problem is without this kind of information. The more you post the easier it will be to identify the problem. You can even make the entire project available (not posted) if needed. – Upholder Of Truth Jan 08 '18 at 22:07
  • Thanks for the responses and sorry for my lack of information. I am doing something somewhat time-intensive in viewDidLoad so I suppose that is the reason behind this! Going to investigate based on that – Logan Jan 08 '18 at 22:09
  • Taking everything out of ViewDidLoad() in controller `B` actually didn't fix anything. To answer some of your questions - controller is created with a simple `let controller = controllerB(stuffToPass: stuffToPass)`, rootViewController is a UINavigationController, and I unfortunately can't really make the project public :( – Logan Jan 08 '18 at 22:26

0 Answers0