Skip to content

Instantly share code, notes, and snippets.

@anupamchugh
Created October 8, 2021 15:27
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 anupamchugh/50ad33d0e6d2a8beb4d87532564f1622 to your computer and use it in GitHub Desktop.
Save anupamchugh/50ad33d0e6d2a8beb4d87532564f1622 to your computer and use it in GitHub Desktop.
struct ContentView : View {
var body: some View {
return ARViewContainer().edgesIgnoringSafeArea(.all)
}
}
struct ARViewContainer: UIViewRepresentable {
func makeUIView(context: Context) -> ARView {
let arView = ARView(frame: .zero)
let config = ARWorldTrackingConfiguration()
config.planeDetection = .horizontal
arView.session.run(config, options: [])
arView.addCoaching()
arView.setupGestures()
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