EditorView
@MainActor
struct EditorView : View
SwiftUI View
for the ChordProEditor
-
The ChordPro document
Declaration
Swift
@Binding var document: ChordProDocument { get nonmutating set }
-
The app state
Declaration
Swift
@Environment var appState: AppState { get }
-
The scene state
Declaration
Swift
@Environment var sceneState: SceneState { get }
-
Chord Display Options
Declaration
Swift
@Environment var chordDisplayOptions: ChordDisplayOptions { get }
-
Show a directive sheet
Declaration
Swift
@State var showDirectiveSheet: Bool { get nonmutating set }
-
The settings for the directive sheet
Declaration
Swift
@State var directiveSettings: EditorView.DirectiveSettings { get nonmutating set }
-
The connector class for the editor
Declaration
Swift
@State var connector: ChordProEditor.Connector { get nonmutating set }
-
Show an
Alert
if we have an errorDeclaration
Swift
@State var errorAlert: AlertMessage? { get nonmutating set }
-
The body of the
View
Declaration
Swift
var body: some View { get }
-
The editor
Declaration
Swift
@MainActor var editor: some View { get }
-
SwiftUI
See moreView
to define a directiveDeclaration
Swift
struct DirectiveSheet : View
-
A button to add a directive with the selected text
Declaration
Swift
func directiveButton(directive: ChordPro.Directive) -> some View
-
Menus with ChordPro directives
Declaration
Swift
@ViewBuilder @MainActor var directiveMenus: some View { get }
-
A button for the text editor to add a directive with a sheet
Note
Shown when there is no selection for the directiveDeclaration
Swift
func directiveSheetButton(directive: ChordPro.Directive) -> some View
-
Apply a
directive
in theChordProEditor
Declaration
Swift
static func format( settings: DirectiveSettings, in editor: ChordProEditor.Connector )
Parameters
settings
The settings for the directive
editor
The connector class for the editor
-
Validate the definition of the chord
Declaration
Swift
@MainActor func validateChordDefinition() -> Bool
Return Value
True or false to show the sheet. If true, the definition will be set or else an alert will be shown
-
/ Directive settings to pass to the sheet
See moreDeclaration
Swift
struct DirectiveSettings : Sendable