I'm trying to reach a settings screen from SKScene
.
This is how I present the settings controller:
let storyboard = UIStoryboard(name: "Main", bundle: nil);
let settingController: UIViewController = storyboard.instantiateViewControllerWithIdentifier("Settings") as UIViewController
let vc = self.view.window.rootViewController;
vc.presentModalViewController(settingController, animated: true);
but once I run this code to dismiss:
@IBAction func backToGame(sender : AnyObject) {
[self.parentViewController .dismissModalViewControllerAnimated(true)];
}
I get EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
error, with nothing shown in the log.
How do I solve this?