TextStorageMonitor

public class TextStorageMonitor : BaseNotificationMonitor

A TextStorageMonitor instance monitors a text storage for the processing of edits to its contents.

  • Encapsulates the processing of edits to the contents of the text storage.

    See more

    Declaration

    Swift

    public enum Event
  • Specifies which events to monitor.

    See more

    Declaration

    Swift

    public struct Options : OptionSet
  • Initializes a new TextStorageMonitor.

    Declaration

    Swift

    public init(textStorage: NSTextStorage,
                options: Options = .all,
                queue: OperationQueue = .main,
                handler: @escaping (Event) -> Void)

    Parameters

    textStorage

    The text storage to monitor.

    options

    The options that specify which events to monitor. By default, all events are monitored.

    queue

    The operation queue on which the handler executes. By default, the main operation queue is used.

    handler

    The handler to call when the text storage has processed or is about to process edits to its contents.

  • The text storage being monitored.

    Declaration

    Swift

    public let textStorage: NSTextStorage
  • Declaration

    Swift

    public override func addNotificationObservers()