I have a file of SKScene which is named "MainScene.swift", and created a button on it for users to jump to another page. The another page was created not by SpriteKit but with UIKit. How can I indicate the target page and write codes in this case?
I usually do like this when jump to the other scene, if I created both pages with SpriteKit.
override func viewDidLoad() {
super.viewDidLoad()
let scene = MainScene(size: CGSize(width: 750, height: 1334))
let skView = self.view as! SKView
scene.scaleMode = .AspectFit
skView.presentScene(scene)
}
And when I do the same thing on a scene which is created with UIKit, type a Storyboard ID on the Identity column, then code like this; I only know the way using storyboard.
class ViewController: UIViewController {
@IBAction func gotoNewPage(sender: AnyObject) {
let nextVC = self.storyboard?.instantiateViewControllerWithIdentifier("newPage")
presentViewController(nextVC!, animated: false, completion: nil)
}
}
But when try same thing between the scene which is created SKScene and UIKit, I've no idea how to specify the latter from the former scene; I'm not sticking to use the storyboard. If there's any simple way, please let me know. Thank you in advance.