Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created January 11, 2021 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sturdysturge/2b38402f1bf8c62fe46261972c19d705 to your computer and use it in GitHub Desktop.
Save sturdysturge/2b38402f1bf8c62fe46261972c19d705 to your computer and use it in GitHub Desktop.
import RealityKit
import SwiftUI
struct ARViewContainer: UIViewRepresentable {
let boxAnchor: Experience.Box
let arView: ARView
let waypoint: ModelEntity
func makeUIView(context: Context) -> ARView {
arView.scene.anchors.append(boxAnchor)
arView.scene.anchors.first?.addChild(waypoint)
return arView
}
func updateUIView(_ uiView: ARView, context: Context) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment