Returns whether a region of the view contains a specified point, accounting for whether the view is flipped or not.
- macOS 10.0+
A point that is expressed in the view's coordinate system. This point generally represents the hot spot of the mouse cursor.
A rectangle that is expressed in the view’s coordinate system.
Point-in-rectangle functions generally assume that the bottom edge of a rectangle is outside of the rectangle boundaries, while the upper edge is inside the boundaries. This method views
a from the point of view of the user—that is, this method always treats the bottom edge of the rectangle as the one closest to the bottom edge of the user’s screen. By making this adjustment, this function ensures consistent mouse-detection behavior from the user’s perspective.
Never use the Foundation’s
NSPoint function as a substitute for this method. It doesn’t account for flipped coordinate systems.