---
title: "pathContains(_:mode:)"
framework: coregraphics
role: symbol
role_heading: Instance Method
path: "coregraphics/cgcontext/pathcontains(_:mode:)"
---

# pathContains(_:mode:)

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

## Declaration

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

## Parameters

- `point`: The point to check, specified in user space units.
- `mode`: A path drawing mode. See doc://com.apple.coregraphics/documentation/CoreGraphics/CGPathDrawingMode.

## Return Value

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

## Discussion

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() for paths drawn directly to the current context, or closeSubpath() for paths first created as CGPath objects and then drawn to the current context.

## See Also

### Examining the Current Graphics Path

- [boundingBoxOfPath](coregraphics/cgcontext/boundingboxofpath.md)
- [currentPointOfPath](coregraphics/cgcontext/currentpointofpath.md)
- [isPathEmpty](coregraphics/cgcontext/ispathempty.md)
