I want to present a GameScene
with GameViewController
from my ViewController
. I tried:
// let GameControllerA2 = GameViewController()
// let transition = CATransition()
// transition.duration = 0.5
// transition.type = kCATransitionPush
// transition.subtype = kCATransitionFromRight
// view.window!.layer.add(transition, forKey: kCATransition)
// self.present(GameControllerA2, animated: true, completion: nil)
if let vc3 = self.storyboard?.instantiateViewController(withIdentifier: "A2ID") as? GameViewControllerA2 {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.window?.rootViewController!.present(vc3, animated: true, completion: nil)
But this all doesn't work. Just if I simply drag [Button] from the Storyboard to the the GameViewController
it doesn't crash, but I need it programmatically.
Any questions about my process? Ask, I'll reply.