SwiftUI + Xcode + OS X: Center container on screen

Hello, I have a Swift program. It utilizes the SwiftUI. I want to place my frame/container in the center of the computer screen. Any advise on how to do so would be appreciated.

Below is what I have so far.

Regards,

Chris

import SwiftUI @main struct Test1App: App {     var body: some Scene {         WindowGroup {             ContentView()         }     } }

import SwiftUI struct ContentView: View {     var body: some View {         Text("Hello, world!")             .frame(width: 500, height: 350)             .background(Color .blue)             .padding()     } }

As far as I know, there is no pure-SwiftUI way. You may need to work with NSWindow.

SwiftUI + Xcode + OS X: Center container on screen
 
 
Q