Contents

rulerView(_:shouldAdd:)

Returns whether a new marker can be added.

Declaration

func rulerView(_ ruler: NSRulerView, shouldAdd marker: NSRulerMarker) -> Bool

Parameters

  • ruler:

    The ruler view sending the message.

  • marker:

    The marker to be added.

Return Value

true if aMarker can be added, false otherwise.

Discussion

The receiver checks for permission to make the change by invoking shouldChangeText(in:replacementString:) and returning the return value of that message. If the change is allowed, the receiver is then sent a rulerView(_:didAdd:) message.

See Also

Supporting the ruler view