Coordinator

class Coordinator: NSObject, NSTextViewDelegate

The coordinator for the ChordProEditor

Protocol Functions

  • Protocol function to check if a text should change

    Declaration

    Swift

    func textView(
        _ textView: NSTextView,
        shouldChangeTextIn affectedCharRange: NSRange,
        replacementString: String?
    ) -> Bool

    Parameters

    textView

    The NSTextView

    affectedCharRange

    The character range that is affected

    replacementString

    The optional replacement string

    Return Value

    True or false

  • Protocol function with a notification that the text has changed

    Declaration

    Swift

    func textDidChange(_ notification: Notification)

    Parameters

    notification

    The notification with the NSTextView as object

  • Protocol function with a notification that the text selection has changed

    Declaration

    Swift

    func textViewDidChangeSelection(_ notification: Notification)

    Parameters

    notification

    The notification with the NSTextView as object

  • Update the text binding with the current text from the `NSTextView

    Note

    With a debounce of one second to prevent too many updates

    Declaration

    Swift

    func updateTextBinding()