Swift95

Workspace​State95

Serializable logical window order, activation, minimization, and frames.

WorkspaceState95 lets an app own and restore the exact state that Workspace95 would otherwise keep transiently.

Use it

import Swift95

private enum Route: Hashable {
  case notes
  case settings
}

private struct WorkspaceStateExample {
  var state = WorkspaceState95<Route>(
    openWindows: [.notes, .settings],
    activeWindow: .notes
  )
}

Essential behavior

BindingPass a Binding to Workspace95 to observe and control its state.
NormalizationInitialization removes duplicate routes and repairs order invariants.
PersistenceThe type is Codable when Route is Codable.

Related

Open the complete WorkspaceState95 API reference →