Instance Method

contains(_:)

Overridden by subclasses to return whether a point lies within the receiver’s region or on the region’s edge—not simply within its bounding rectangle.

Declaration

func contains(_ point: NSPoint) -> Bool

Parameters

aPoint

The point in question.

Return Value

true if aPoint lies within the receiver’s region or on the region’s edge—not simply within its bounding rectangle—false otherwise.

Discussion

For example, if the receiver defines a donut shape and aPoint lies in the hole, this method returns false. This method can be used for hit testing of mouse events.

The default NSTextContainer implementation merely checks that aPoint lies within its bounding rectangle.

See Also

Deprecated

init(containerSize: NSSize)

Initializes a text container with a specified bounding rectangle.

Deprecated
func lineFragmentRect(forProposedRect: NSRect, sweepDirection: NSLineSweepDirection, movementDirection: NSLineMovementDirection, remaining: NSRectPointer?) -> NSRect

Overridden by subclasses to calculate and return the longest rectangle available in the proposed rectangle for displaying text, or NSZeroRect if there is none according to the receiver’s region definition.

Deprecated