Yes, Apple ought to make this easier for all of us, but for the time being, here is the most viable solution for my needs:
Avoid subclassing
Sure, that may not be at all possible, but in my case, the subclass I had in mind contains logic to control the graphics I laid out in the SKS file ... Sounds awfully close to ViewController, doesn't it?
I created a OverlayController
class, and I initialize it with:
self.childNodeWithName(Outlet.OverlayNode)!
So now, overlay node is just a dumb node, and the controller is the full fledged subclass that has all the goodies.
But there is more
Just throwing this in to sweeten the deal:
private extension SKNode {
var progressBar: SKNode {
return self.childNodeWithName("ProgressBar")!
}
}
This is a private extension inside the new controller class file, so we can painlessly access the children of the dumb SKNode
.
Pain point
An admittedly painful point is touch handling. It's natural to subclass an SKNode to do custom touch handling, and the composition approach hardly does anything on that front. I'm forwarding touches from the scene for now, but would post updates if there is a better way.