OK, discovered the problem which lead to another.
When porting my Delegate file from Swift to SwiftUI I had declared in a global variable file:
var proton = SCNGeometry() ,which the var is. It is user selectable between:
class Particle:SCNGeometry, SCNPhysicsContactDelegate {} and
class WireFrameParticle:SCNGeometry, SCNPhysicsContactDelegate {}
Experimenting, I found if I declare var proton = Particle() in the global var file, I get my desired SCNScene as SceneView.
Likewise if var = WireFrameParticle(), I get the desired SCNScene as SceneView.
When the user selects the "other" class from an options.toolbar where the var proton is reassigned, the program bombs, e.g., "Cannot assign WireFrameParticle to Particle". So, I modify my global var file to:
var proton:SCNGeometry = Particle()
The program no longer bombs but neither do I have the desired SCNScene in SceneView, again.
There must be a way to declare/reassign the var proton, and have my scene too.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: