WindowingScene.swift 630 B

123456789101112131415
  1. /// A scene that represents one or more windows.
  2. ///
  3. /// This is needed so we can share the `WindowReference` code between ``Window``
  4. /// and ``WindowGroup`` (as well as any other windowing scenes we decide to
  5. /// add in the future), without having to awkwardly abstract the window state
  6. /// into a separate `struct`.
  7. protocol WindowingScene: Scene {
  8. associatedtype Content: View
  9. /// The title for all windows managed by this scene.
  10. var title: String { get }
  11. /// The content of all windows managed by this scene.
  12. ///
  13. /// Each window should have its own state copy.
  14. var content: () -> Content { get }
  15. }