processEditing(for:edited:range:changeInLength:invalidatedRange:)
Notifies the observer that the text storage has been edited.
Declaration
func processEditing(for textStorage: NSTextStorage, edited editMask: NSTextStorage.EditActions, range newCharRange: NSRange, changeInLength delta: Int, invalidatedRange invalidatedCharRange: NSRange)Parameters
- textStorage:
The text storage that was edited.
- editMask:
The type of edit.
- newCharRange:
The range of characters that changed.
- delta:
The change in length.
- invalidatedCharRange:
The full invalidated range including attribute fixing.
Discussion
The newCharRange is the range in the final string which was explicitly edited. The invalidatedRange includes portions that changed as a result of attribute fixing — it is either equal to newCharRange or larger. Controllers should not change the contents of the text storage during the execution of this message.