我尝试在SKScene上按下按钮后呈现ViewController。我怎样才能做到这一点?
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
let touch = touches.first
if let location = touch?.location(in: self) {
let node = self.nodes(at: location)
if node[0].name == "newGameButton" {
let transition = SKTransition.flipHorizontal(withDuration: 0.5)
let gameScene = GameScene(size: self.size)
self.view!.presentScene(QuestionViewController, transition: transition)
}
}