I am making a game using SpriteKit and swift. Some of my nodes have runBlock actions which call functions:
SKAction.runBlock(someFunction)
When I encode and decode my scene using NSCoder
I get this message printed in the console
SKAction: Run block actions can not be properly encoded,
Objective-C blocks do not support NSCoding.
Swift does not support selector SKActions so how can I solve this problem.
TL;DR: How can I make an SKAction which calls a function and is encodable?
is there another type of SKAction that does this?
should I crete a customer SKAction subclass?
Any help is much appreciated :)