Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 如何让你的按钮只在它完成你想要的事情之后,像一个完成块_Swift - Fatal编程技术网

Swift 如何让你的按钮只在它完成你想要的事情之后,像一个完成块

Swift 如何让你的按钮只在它完成你想要的事情之后,像一个完成块,swift,Swift,如何使场景在这两个功能完成之前不发生变化? 谢谢 代码: 不要将按钮直接链接到序列。将其链接到iAction。在iAction中编写您想要的代码,然后在步骤完成后使用performsguewithidentifier调用segue 谢谢,但我还是有点迷路。你能把我的行动写出来吗 let location = touch.locationInNode(self) if self.nodeAtPoint(location) == self.playButton { PlayPressDow

如何使场景在这两个功能完成之前不发生变化? 谢谢

代码:


不要将按钮直接链接到序列。将其链接到iAction。在iAction中编写您想要的代码,然后在步骤完成后使用
performsguewithidentifier
调用segue

谢谢,但我还是有点迷路。你能把我的行动写出来吗
let location = touch.locationInNode(self)

if self.nodeAtPoint(location) == self.playButton {
    PlayPressDown()
    PressedPlay()

    println(" PlayBtn Going to game play.")

    var scene = SecondScene(size: self.size)
    let sKView = self.view! as SKView

    sKView.ignoresSiblingOrder = true
    scene.size = sKView.bounds.size

    let reveal = SKTransition.fadeWithDuration(1.1)

    sKView.presentScene(scene, transition: reveal)