mardi 24 mars 2015

how to present a uiviewcontroller over a spritekit scene

Hi I have seen many questions about this topic but none seem to solve my situation. I want to present a UIView controller over an SKScene when the user win/dies. I created a PresentWinLoseViewController : UIViewController subclass and connected it in story board. I created a segue from GameViewController to PresentWinLoseViewController in storyboard plus two exit segues from PresentWinLoseViewController back to GameViewController.


Here is how I am calling these. In my SKScene when I win/lose



func win() {
let gameVC = GameViewController()
gameVC.performSegueWithIdentifier("tryAgain", sender: self)
}


and my exit segues from PresentWinLoseViewController



@IBAction func tryAgainButtonPressed(segue:UIStoryboardSegue) {

self.performSegueWithIdentifier("unwindTryAgain", sender: self)

}


but I cant even get that far bc the first segue never works. I keep getting



Receiver (<SpriteLevelBuilder.GameViewController: 0x7ff2b5e49210>) has no segue with identifier 'tryAgain''


what am i doing wrong?




Aucun commentaire:

Enregistrer un commentaire