---
title: "add(_:)"
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: "gameplaykit/gkgraph/add(_:)"
---

# add(_:)

Adds the specified nodes to the graph.

## Declaration

```swift
func add(_ nodes: [GKGraphNode])
```

## Parameters

- `nodes`: An array of graph node objects—instances of doc://com.apple.gameplaykit/documentation/GameplayKit/GKGraphNode or of one of its subclasses that adds geometry information.

## Discussion

Discussion Calling this method does not connect the newly added nodes to others in the graph.

## See Also

### Working with Nodes in a Graph

- [connectToLowestCostNode(node:bidirectional:)](gameplaykit/gkgraph/connecttolowestcostnode(node:bidirectional:).md)
- [remove(_:)](gameplaykit/gkgraph/remove(_:).md)
- [nodes](gameplaykit/gkgraph/nodes.md)
