Instance Method

processEditing()

Cleans up changes made to the receiver and notifies its delegate and layout managers of changes.

Declaration

func processEditing()

Discussion

This method is automatically invoked in response to an edited(_:range:changeInLength:) message or an endEditing() message if edits were made within the scope of a beginEditing() block. You should never need to invoke it directly.

This method begins by posting an NSTextStorageWillProcessEditing to the default notification center (which results in the delegate receiving a textStorageWillProcessEditing: message). Then it fixes attributes. After this, it posts an NSTextStorageDidProcessEditing to the default notification center (which results in the delegate receiving a textStorageDidProcessEditing: message). Finally, it sends a textStorage(_:edited:range:changeInLength:invalidatedRange:) message to each of the receiver’s layout managers using the argument values provided.

See Also

Handling Text Editing Messages

func edited(NSTextStorageEditActions, range: NSRange, changeInLength: Int)

Tracks changes made to the receiver, allowing the text storage to record the full extent of changes made.

func ensureAttributesAreFixed(in: NSRange)

Ensures that attributes are fixed in the given range.

var fixesAttributesLazily: Bool

A Boolean value indicating whether the text storage object fixes attributes lazily.

func invalidateAttributes(in: NSRange)

Invalidates attributes in the specified range.