2

如何实现调用带参数的函数的完成处理程序?

myNode.runAction(SCNAction.moveByX(0, y: 40, z: 0, duration: 1), completionHandler: foo(param))
4

1 回答 1

1

编写它的最短方法是使用闭包:

myNode.runAction(SCNAction.moveByX(0, y: 40, z: 0, duration: 1), completionHandler:{param in /* What ever you need to do*/})
于 2014-08-13T15:00:30.177 回答