ARView, RealityKit in SwiftUI? Target: ARKit 4

I am targeting releasing my app when ARKit 4 is released. I wonder if/how to use ARView and RealityKit in the SwiftUI. Are we still embedding UIView into SwiftUI? Thanks!
Answered by brandonK212 in 626118022
Yes, in essence, you'll be adding your ARView to SwiftUI using either an UIViewControllerRepresentable or UIViewRepresentable, depending on your needs. It is worth noting that if you create a new AR project in Xcode 12, you can opt to use the RealityKit content technology and SwiftUI as your interface. This will generate your main ContentView and ARView, embedding it in the UIViewRepresentable automatically for you.
Accepted Answer
Yes, in essence, you'll be adding your ARView to SwiftUI using either an UIViewControllerRepresentable or UIViewRepresentable, depending on your needs. It is worth noting that if you create a new AR project in Xcode 12, you can opt to use the RealityKit content technology and SwiftUI as your interface. This will generate your main ContentView and ARView, embedding it in the UIViewRepresentable automatically for you.
ARView, RealityKit in SwiftUI? Target: ARKit 4
 
 
Q