Instance Method


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


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



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.


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.