<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGContext/pathContains(_:mode:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "c:@F@CGContextPathContainsPoint"
  },
  "title" : "pathContains(_:mode:)"
}
-->

# pathContains(_:mode:)

Checks to see whether the specified point is contained in the current path.

```
func pathContains(_ point: CGPoint, mode: CGPathDrawingMode) -> Bool
```

## Parameters

`point`

The point to check, specified in user space units.

`mode`

A path drawing mode. See [`CGPathDrawingMode`](/documentation/CoreGraphics/CGPathDrawingMode).

## Return Value

Returns `true` if `point` is inside the current path of the graphics context; `false` otherwise.

## Discussion

A point is contained within the path of a graphics context if the point is inside the painted region when the path is stroked or filled with opaque colors using the specified path drawing mode. A point can be inside a path only if the path is explicitly closed by calling the function [`closePath()`](/documentation/CoreGraphics/CGContext/closePath()) for paths drawn directly to the current context, or [`closeSubpath()`](/documentation/CoreGraphics/CGMutablePath/closeSubpath()) for paths first created as [`CGPath`](/documentation/CoreGraphics/CGPath) objects and then drawn to the current context.

---

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)