Mac Developer Library

Developer

AppKit Framework Reference NSTextStorageDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSTextStorageDelegate

Inheritance


Not Applicable

Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.6 and later.

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(_ aNotification: 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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    Available as part of an informal protocol prior to OS X v10.6.

  • Sent when a text storage has finished processing edits.

    Declaration

    Swift

    optional func textStorageDidProcessEditing(_ aNotification: 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).

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    Available as part of an informal protocol prior to OS X v10.6.