CreateChordView

public struct CreateChordView : View

A SwiftUI View to create a ChordDefinition with pickers

To use this View, the ChordDisplayOptions class must be added to your application as an Environment

  • Init the View

    Declaration

    Swift

    public init()
  • Chord Display Options object

    Declaration

    Swift

    @Environment
    private var chordDisplayOptions: ChordDisplayOptions { get }
  • The chord diagram

    Declaration

    Swift

    @State
    private var diagram: ChordDefinition? { get nonmutating set }
  • The current color scheme

    Declaration

    Swift

    @Environment
    private var colorScheme: ColorScheme { get }
  • The chord finder result

    Declaration

    Swift

    @State
    private var chordFinder: [ChordDefinition] { get nonmutating set }
  • The chord components result

    Declaration

    Swift

    @State
    private var chordComponents: [[Chord.Root]] { get nonmutating set }
  • The body of the View

    Declaration

    Swift

    public var body: some View { get }
  • The diagram View

    Declaration

    Swift

    @ViewBuilder
    func diagramView(width: Double) -> some View
  • Check if a note is required for a chord

    The first array of the chordComponents contains all notes

    The last array of the chordComponents contains the least notes

    Declaration

    Swift

    func checkRequiredNote(note: Chord.Root) -> Bool

    Parameters

    note

    The note to check

    Return Value

    True or False

  • The header View

    Declaration

    Swift

    func header(text: String) -> some View

    Parameters

    text

    The text as String

    Return Value

    A View with the header title