# `GSLayer indexPathOfNode(atY:)`

*Instance Method*

The index path of an on-curve node near the given y position and the matched node position.

## Declaration

```swift
func indexPathOfNode(atY y: CGFloat) -> (indexPath: IndexPath, position: CGPoint)?
```

## Discussion

Returns `nil` when no matching node or hint position is found.

## See Also

### Node Hit Testing

- [`GSLayer nodeAtPoint:excludeNode:ignoreLocked:tolerance:`](/Core/GlyphsCore/GSLayer/nodeAtPoint:excludeNode:ignoreLocked:tolerance:) — Returns the nearest node to a point, excluding one node.
- [`GSLayer nodeAtPoint:excludeNodes:traverseComponents:ignoreLocked:tolerance:`](/Core/GlyphsCore/GSLayer/nodeAtPoint:excludeNodes:traverseComponents:ignoreLocked:tolerance:) — Returns the nearest node to a point, excluding a set of objects.
- [`GSLayer indexPathOfNode(atX:)`](/Core/GlyphsCore/GSLayer/indexPathOfNode(atX:)) — The index path of an on-curve node near the given x position and the matched node position.

