title: SwiftUI on MacOS. - Opening a new Window
body: <p>In my MacOS SwiftUI App I want to display some views in new Windows. The calls shall be possible from several parts of the code so I decided, do implement it as a static func of as special struct like this.<br />
  Works fine - there is something to be said against it?</p>
  <pre><code>struct Appwindows {
    
    static func newWindow(forSpecialView view: SpecialView, title: String = &quot;new Window&quot;)
   { let newWindow = newWindowInternal(title: title)!
     
      newWindow.contentView = NSHostingView(rootView: view)
   }
    
    private static func newWindowInternal(title: String = &quot;new Window&quot;) -&gt; NSWindow!
   { var newWindow: NSWindow!
     newWindow = NSWindow(
       contentRect: NSRect(x: 20, y: 20, width: 680, height: 600),
       styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView],
       backing: .buffered,
       defer: false)
       newWindow.center()
       newWindow.isReleasedWhenClosed = false
       newWindow.title = title
       newWindow.makeKeyAndOrderFront(nil)
       return newWindow
   }
  }
  </code></pre>
  <p>Is there a way to make it more generic, so that any kind of views could be passed to the func?</p>