0

When I call View Controller B (ProfileController) from View Controller A, using self.present(navControllerProfile, animated: false, completion: nil), View Controller A is displayed again quickly before switching to B. I use the same code to call other View Controllers from View Controller A and the transition works perfectly, only the transition to B presents this "bug". Has anyone ever come up with a similar problem and managed to solve it? Thank you.

if self.view?.window == nil {
    self.window = UIWindow(frame: UIScreen.main.bounds)
}
self.view.window?.layer.add(self.transition, forKey: kCATransition)
if let profileInstantiated = self.storyboard!.instantiateViewController(withIdentifier: "ProfileController") as? ProfileController{
    let navControllerProfile = UINavigationController(rootViewController: profileInstantiated)
    //Transition with "bug" bellow
    self.present(navControllerProfile, animated:false, completion: nil)
}
iOShit I Screwed Up
  • 677
  • 2
  • 12
  • 33
Enzo
  • 73
  • 2
  • 8

1 Answers1

0

After several tests and unable to detect the cause of the problem, I finally solved the bug by applying the solution proposed by HotJard in this link: How to present view controller from right to left in iOS using Swift

Enzo
  • 73
  • 2
  • 8