I need to make a segue from a GameScene to a UIViewController. My code so far is the following:
In the GameViewController.swift I added:
if let view = self.view as! SKView? {
if let scene = SKScene(fileNamed: "GameScene") {
scene.scaleMode = .aspectFill
scene.viewController = self
view.presentScene(scene)
}
...
and in my GameScene.swift I added
class GameScene: SKScene, SKPhysicsContactDelegate {
var viewController: UIViewController?
...
as well as
func returnToMainMenu(){
self.viewController.performSegueWithIdentifier("push", sender: viewController)
}
So my problem is that when I state - scene.viewController = self - I get an error that says "value of type 'SKScene' has no member 'viewController'". What can I do to fix this?