<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/isMousePoint(_:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(im)mouse:inRect:"
  },
  "title" : "isMousePoint(_:in:)"
}
-->

# isMousePoint(_:in:)

Returns whether a region of the view contains a specified point, accounting for whether the view is flipped or not.

```
func isMousePoint(_ point: NSPoint, in rect: NSRect) -> Bool
```

## Parameters

`point`

A point that is expressed in the view’s coordinate system. This point generally represents the hot spot of the mouse cursor.

`rect`

A rectangle that is expressed in the view’s coordinate system.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if `aRect` contains `aPoint`, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

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 `aRect` 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 <doc://com.apple.documentation/documentation/Foundation/NSPointInRect(_:_:)> function as a substitute for this method. It doesn’t account for flipped coordinate systems.

## See Also

[`-  convertPoint:fromView:`](/documentation/AppKit/NSView/convert(_:from:)-1dq9l)

Converts a point from the coordinate system of a given view to that of the view.

  <doc://com.apple.documentation/documentation/Foundation/NSMouseInRect(_:_:_:)>

[`flipped`](/documentation/AppKit/NSView/isFlipped)

A Boolean value indicating whether the view uses a flipped coordinate system.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)