I am not sure there is a proper way, code with SpriteKit can be sometimes not very proper but can work good.
I would do the same, or doing that with icon Nodes in a list or using a loop. I have a code like you (with more nodes, I use a list of node, I check a condition and if true i run the animation on these node)
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: