Reputation: 9848
How do I implement a completion handler that calls a function that takes parameters?
myNode.runAction(SCNAction.moveByX(0, y: 40, z: 0, duration: 1), completionHandler: foo(param))
Upvotes: 2
Views: 1121
Reputation: 1252
The shortest way to write it is with a closure:
myNode.runAction(SCNAction.moveByX(0, y: 40, z: 0, duration: 1), completionHandler:{param in /* What ever you need to do*/})
Upvotes: 1