如何实现调用带参数的函数的完成处理程序?
myNode.runAction(SCNAction.moveByX(0, y: 40, z: 0, duration: 1), completionHandler: foo(param))
答案 0 :(得分:1)
编写它的最短方法是使用闭包:
myNode.runAction(SCNAction.moveByX(0, y: 40, z: 0, duration: 1), completionHandler:{param in /* What ever you need to do*/})