# `GSGuide hitTest:inLayer:tolerance:`

*Instance Method*

Whether a point is within a given distance of the guide.

## Declaration

```swift
func hitTest(_ aPoint: NSPoint, in layer: GSLayer, tolerance: CGFloat) -> Bool
```

```objc
- (BOOL) hitTest:(NSPoint) aPoint inLayer:(GSLayer *) layer tolerance:(CGFloat) tolerance;
```

```python
hitTest_inLayer_tolerance_(aPoint: NSPoint, layer: GSLayer, tolerance: float) -> bool
```

## Parameters

- `aPoint` — The point to test.
- `layer` — The layer in whose coordinate system the point is expressed.
- `tolerance` — The maximum distance in font units.

## Discussion

The distance is measured from the boundary of the guide in font units. For a line guide, the layer width determines the endpoints used for the test.

## See Also

### Interaction

- [`GSGuide.handle`](/Core/GlyphsCore/GSGuide/handle) — A transient handle for rotating the guide.

