# `GSLayer indexPathOfNode:`

*Instance Method*

Returns the index path of a node in this layer.

## Declaration

```swift
func indexPath(of node: GSNode) -> IndexPath?
```

```objc
- (NSIndexPath *) indexPathOfNode:(GSNode *) node;
```

```python
indexPathOfNode_(node: GSNode) -> NSIndexPath
```

## Discussion

The first index is the linear path index and the second index is the node index in that path. Returns `nil` when the node does not belong to this layer.

## See Also

### Nodes

- [`GSLayer.allNodes`](/Core/GlyphsCore/GSLayer/allNodes) — All nodes from all path shapes in linear shape order.
- [`GSLayer allNodesCount`](/Core/GlyphsCore/GSLayer/allNodesCount) — The number of nodes in all path shapes.
- [`GSLayer nodeAtIndexPath:`](/Core/GlyphsCore/GSLayer/nodeAtIndexPath:) — Returns the node at an index path.
- [`GSLayer.selNode`](/Core/GlyphsCore/GSLayer/selNode) — The selected node when exactly one node is selected.
- [`GSLayer sortedSelectedNodes`](/Core/GlyphsCore/GSLayer/sortedSelectedNodes) — The selected nodes in path order.

