0

the SoundControoler is the UIViewControlloer that I am currently at and i need to get the GameScene which is an Skcene.

Code:

import AVFoundation
import Foundation
import SpriteKit
import GameKit
import UIKit
import iAd

class SoundController: UIViewController {

  override func viewDidLoad()  {
    super.viewDidLoad()
 }

I know how to go to the UIViewController(SoundBoardController) from the SKcene but can't figure out how to do it the other way around.Below is the code I used to go from the SKcene to the ViewController.

 func GotoSoundBoard(){
    var vc: UIViewController = UIViewController()
    vc = self.view!.window!.rootViewController!
    vc.performSegueWithIdentifier("SoundSegue", sender: vc)
}

Below is the SKcene i need to get to

import AVFoundation
import Foundation
import SpriteKit 
import GameKit
import UIKit

class GameScene: SKScene {

  override func didMoveToView(view: SKView) {

  }
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Hunter
  • 1,321
  • 4
  • 18
  • 34

1 Answers1

1

You want to look at unwind segues. It has been asked previously. Take a look at this Stack Overflow question.

Community
  • 1
  • 1
Raymond Law
  • 1,188
  • 1
  • 10
  • 14