Here is my code:
and This is ContentView.swift
I want to make a button to return ARViewContainer.
I tried this but it doesn't work:
What should I do?
Code Block swift struct ARDisplayView: View { var body: some View { return ARViewContainer().edgesIgnoringSafeArea(.all) } } struct ARViewContainer: UIViewRepresentable { var arView = ARView(frame: .zero) func makeCoordinator() -> Coordinator { Coordinator(parent: self) } class Coordinator: NSObject, ARSessionDelegate { var parent: ARViewContainer var videoPlayer: AVPlayer! init(parent: ARViewContainer) { self.parent = parent } blahblah...
and This is ContentView.swift
Code Block swift import SwiftUI import RealityKit struct ContentView: View { var body: some View { ARDisplayView() } }
I want to make a button to return ARViewContainer.
I tried this but it doesn't work:
Code Block swift Button(action: { return ARViewContainer().edgesIgnoringSafeArea(.all) }) { Text("Start AR") }
What should I do?