Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何实现调用带参数的函数的完成处理程序?
myNode.runAction(SCNAction.moveByX(0, y: 40, z: 0, duration: 1), completionHandler: foo(param))
编写它的最短方法是使用闭包:
myNode.runAction(SCNAction.moveByX(0, y: 40, z: 0, duration: 1), completionHandler:{param in /* What ever you need to do*/})