Search code examples
watchkitscenekit

Implement SCNSceneRendererDelegate on watchOS


On iOS, I can use SCNSceneRendererDelegate and implement renderer(_:updateAtTime:) in order to update my scene just before every frame is rendered. I set this up by doing this in my view controller:

(self.view as! SCNView).delegate = self

SCNSceneRendererDelegate is available on watchOS. However, on watchOS I don't have access to an SCNView, so I can't set its delegate. Is there any way, on watchOS, to get a callback right before each frame renders so that I can update my scene?


Solution

  • On watchOS you deal with WKInterfaceSCNScene (instead of SCNView) which also conforms to the SCNSceneRenderer protocol.