SwiftUI – Passing data from SwiftUIView to SceneKit
问题 Goal: SwiftUI toggle button that controls a SwiftUI View with Scenekit (UIViewRepresentable) // show statistics such as fps and timing information What I did: This is the UIViewRepresentable ScenekitView import SwiftUI import SceneKit struct ScenekitView : UIViewRepresentable { let scene = SCNScene(named: "art.scnassets/ship.scn")! func makeUIView(context: Context) -> SCNView { // create and add a camera to the scene let cameraNode = SCNNode() cameraNode.camera = SCNCamera() scene.rootNode