With Monterey on iMac - I want to create multiple Views and have them all visible within a single Scene. It's an attempt to overcome slow UI updates. so I'm hoping for better performance.
This following example works. It displays View1 with View2 directly below, but how could they be display side-by-side? How could I position any number of views and arrange them in any way I choose?
@main
struct SceneryApp: App {
@StateObject var vm1 = Model1()
@StateObject var vm2 = Model2()
var body: some Scene {
WindowGroup {
View1()
.frame(width: 200, height: 300)
.border(.gray, width: 1)
.padding()
.environmentObject(vm1)
View2()
.frame(width: 200, height: 300)
.border(.gray, width: 1)
.padding()
.environmentObject(vm2)
}
}
}