Mac Developer Library

Developer

AppKit Framework Reference NSTextStorageDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSTextStorageDelegate

The NSTextStorageDelegate protocol defines the optional methods implemented by delegates of NSTextStorage objects.

  • Sent when a text storage is about to process edits.

    Declaration

    Swift

    optional func textStorageWillProcessEditing(_ notification: NSNotification)

    Objective-C

    - (void)textStorageWillProcessEditing:(NSNotification *)aNotification

    Parameters

    aNotification

    Discussion

    The delegate can verify the changed state of the text storage object and make changes to the text storage object’s characters or attributes to enforce whatever constraints it establishes. Programmatic changes don’t result in this message being sent.

    Availability

    Available in OS X v10.0 through OS X v10.10.3.

  • textStorageDidProcessEditing(_:) - textStorageDidProcessEditing: Available in OS X v10.0 through OS X v10.10.3

    Sent when a text storage has finished processing edits.

    Declaration

    Swift

    optional func textStorageDidProcessEditing(_ notification: NSNotification)

    Objective-C

    - (void)textStorageDidProcessEditing:(NSNotification *)aNotification

    Parameters

    aNotification

    Discussion

    The delegate can verify the final state of the text storage object; it can’t change the text storage object’s characters without leaving it in an inconsistent state, but if necessary it can change attributes. Note that even in this case it’s possible to put a text storage object into an inconsistent state—for example, by changing the font of a range to one that doesn’t support the characters in that range (such as using a Latin font for Kanji text).

    Availability

    Available in OS X v10.0 through OS X v10.10.3.