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
  • 298,130
  • 40
  • 468
  • 517
Hunter
  • 1,171
  • 3
  • 11
  • 27

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
rayvinly
  • 1,158
  • 1
  • 9
  • 14