在 SwiftUI 中使用 SceneDelegate 时,可以创建如下所示的函数,用于设置视图,如下所示。但是,在最新版本中,我们现在使用 WindowsGroup。是否可以编写一个函数来更改 WindowsGroup 中的视图?
func toContentView() {
let contentView = ContentView()
window?.rootViewController = UIHostingController(rootView: contentView)
}