Contents

rulerView(_:didAdd:)

Modifies the paragraph style of the paragraphs containing the selection to accommodate a new marker.

Declaration

func rulerView(_ ruler: NSRulerView, didAdd marker: NSRulerMarker)

Parameters

  • ruler:

    The ruler view sending the message.

  • marker:

    The marker that was added.

Discussion

This method records the change by invoking didChangeText() after adding the marker.

NSTextView checks for permission to make the change in its rulerView(_:shouldAdd:) method, which invokes shouldChangeText(in:replacementString:) to send out the proper request and notifications, and only invokes this method if permission is granted.

See Also

Related Documentation

Supporting the ruler view