ChordProEditor
struct ChordProEditor: NSViewRepresentable
SwiftUI NSViewRepresentable for the ChordPro editor
-
The
Bindingto the text of the documentDeclaration
Swift
var text: String -
The parsed song lines
Declaration
Swift
let lines: [Song.Section.Line] -
The ‘introspect’ callback with the editor
InternalsDeclaration
Swift
private(set) var introspect: IntrospectCallback? -
Make a
coordinatorfor theNSViewRepresentableDeclaration
Swift
func makeCoordinator() -> CoordinatorReturn Value
A
coordinator -
Make the
ViewDeclaration
Swift
func makeNSView(context: Context) -> WrapperParameters
contextThe context
Return Value
The wrapped editor
-
Update the
ViewDeclaration
Swift
func updateNSView(_ wrapper: Wrapper, context: Context)Parameters
wrapperThe wrapped editor
contextThe context
-
Highlight the text in the editor
Declaration
Swift
func highlightText(textView: NSTextView, range: NSRange? = nil)Parameters
textViewThe current
TextViewrangeThe range to highlight
-
The coordinator for the
See moreChordProEditorDeclaration
Swift
class Coordinator: NSObject, NSTextViewDelegate -
Share internal editor stuff with the SwiftUI
See moreViewDeclaration
Swift
struct Internals: Sendable
-
The layout manager for the editor
See moreDeclaration
Swift
class LayoutManager: NSLayoutManager, NSLayoutManagerDelegate
-
The line numbers view for the editor
See moreDeclaration
Swift
class LineNumbersView: NSRulerView
-
The text view for the editor
See moreDeclaration
Swift
class TextView: NSTextView
-
Declaration
Swift
class Wrapper: NSView, ChordProEditorDelegate
-
Introspect for the editor
Declaration
Swift
func introspect(callback: @escaping IntrospectCallback) -> SelfParameters
callbackThe callback function
Return Value
Itself
View on GitHub