Instance Method

accessibilityHitTest(_:)

Returns the deepest descendant of the accessibility hierarchy that contains the specified point.

Declaration

func accessibilityHitTest(_ point: NSPoint) -> Any?

Parameters

point

The point being hit-tested, in lower-left relative screen coordinates.

Return Value

The deepest accessibility element in the accessibility hierarchy that contains the specified point.

Discussion

You can assume that the specified point has already been determined to lie within the accessibility element's frame. Override this method to do deeper hit-testing by identifying which child element, if any, contains the point. NSMatrix, for example, identifies which of its cells contains the point and propagates the hit-test to it.

If the specified point is not contained within one of the accessibility element's children, either return self or, if available, invoke the superclass's implementation. The default NSView and NSCell implementations test whether the accessibility element is an ignored element and, if it is, return the receiver's first unignored parent; otherwise they return self.

See Also

Available Methods and Properties

var accessibilityFocusedUIElement: Any?

The deepest descendant of the accessibility hierarchy that has the focus.

var accessibilityNotifiesWhenDestroyed: Bool

A Boolean value that indicates whether a custom accessibility object sends a notification when its corresponding UI element is destroyed.