I have tried several different answers and have yet to find an answer that works.
I keep getting
fatal error: unexpectedly found nil while unwrapping an Optional value
I have a SKScene called selectUpgrade that is in my GameViewController and I am trying to segue to a UIViewController called MissileUpgrade.
var vc2 = MissileUpgrade() //trying to get to this UIViewController
var gameVC = GameViewController() // currently in a scene in this UIViewController
I am calling this in my scene to segue
func goToMissileUpgrade() {
gameVC.presentViewController(vc2, animated: true, completion: nil)
}
These are in the same storyboard. If I set MissileUpgrade as the initial VC it will load fine so I know it has nothing to do on that end. I am lost on why this is not working. Thanks for your help!
GameViewController
, shouldn't your code beself. presentViewController
instead ofgameVC.presentViewController
? – paulvsgameVC
orvc2
nil? – paulvs