0

I've tried literally countless and various ways to back to my initial viewController but I can't get anything to work. If any of you guys can see what i'm doing wrong I would be incredibly happy.

Just to make sure I have a print statement in every scene and every viewcontroller and initially the rootviewcontroller print statement does work but I know it's not fully transitioning over since the print statement isn't happening again.

Below is a snippet of the transition code and below that a picture of my storyboard:

func menu()
{
    self.view?.presentScene(nil)

    //let theVC = self.viewController?.storyboard?.instantiateViewController(withIdentifier: "menuVC") as! MenuVC?

    //self.viewController?.navigationController?.pushViewController(theVC!, animated: true)
    self.viewController?.dismiss(animated: false, completion: nil)

    self.viewController?.navigationController?.popToRootViewController(animated: true)
    print("LastScene")
}

enter image description here

insta catering
  • 151
  • 2
  • 12
  • self.view?.presentScene(nil) what this function does ? – Roma Feb 06 '17 at 08:18
  • @Roma I did that so I could get out of the scene before I push the new viewcontroller. If I don't do that, it seems to still show the old scene. – insta catering Feb 06 '17 at 18:41
  • can you add code from presentScene and code where you pushing to this ViewController – Roma Feb 07 '17 at 07:55
  • The code I have above is the code i have in my 3rd viewcontroller in my 3rd scene (which is loading perfectly fine). I used the exact same transitioning to go from 1st VC to the 2nd VC to the 3rd VC. But when I try to use it to go from 3rd VC back to 1st, it doesn't work. – insta catering Feb 07 '17 at 16:07
  • I call that piece of transition code inside of the scene for the 3rd VC but i'm also doing that inside of the scene of my 2nd VC to go the 3rd and it's perfectly fine so why is it not working to go from 3rd back to 1st? – insta catering Feb 07 '17 at 16:08

0 Answers0