ChordProviderApp
struct ChordProviderApp: App
SwiftUI Scene
for Chord Provider
This is the starting point of the application
Note
Each platform has its ownbody
-
The observable
FileBrowser
classDeclaration
Swift
private var fileBrowser = FileBrowser()
-
The state of the app
Declaration
Swift
private var appState = AppState(id: "Main")
-
The
AppDelegate
class for Chord ProviderDeclaration
Swift
private var appDelegate: AppDelegate
-
The
openWindow
environment to open a new WindowDeclaration
Swift
private var openWindow
-
The body of the
Scene
The macOS
body
consist of the following scenes:Window
: scene with a list of songsWindow
: scene to export a folder of songsDocumentGroup
scene to open a single songMenuBarExtra
scene that shows a list with songs as wellSettings
scene to open the settings Window
Declaration
Swift
var body: some Scene
-
The window scenes we can open on macOS
Note
The ID of a scene we set on on aWindow
or to open aWindow
in the environment is aString
. This is is asking for troubles, so I use anenum
instead.Declaration
Swift
private enum AppSceneID: String