App SwiftUI

App SwiftUI

So far, no customization. No use of app delegate proxy.

App Source contains

  • Properties: Top level properties: model, persistence controller (Core Data).
  • WindowGroup or DocumentGroup (body:Scene property)
  • Closure with top level view
  • set environment object (top level model object, system or app state)
  • set environment managed object context (Core Data)
  • set focused scene value (document)

These are top level model, scene and view parts.

Examples

TextLibrary6

  • Top level model, Core Data persistence
  • WindowGroup:Scene
  • Top level view with model environment object and persistence environment property.

WikiPad

  • DocumentGroup:Scene with commands modifier.
  • Top level view with document state (key selection and history) environment object and document focused scene value modifiers.

TextJournal

  • DocumentGroup:Scene with commands modifier.
  • Top level view with document state (key selection and history) environment object and document focused scene value modifiers.

PlainText3

  • Top level model (show find replace, active document workaround) and app state (show vocabulary).
  • DocumentGroup:Scene with #if conditional OSX or IOS commands modifier.
  • Top level view #if conditional OSX or IOS.

Lifecycle

  • Uses AppDelegate and @NSApplicationDelgateAdaptor.
  • Uses environment property scenePhase and WindowGroup:Scene onChange(of: scenePhase).
Advertisement