---
title: "remove(_:using:)"
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: "gameplaykit/gkquadtree/remove(_:using:)"
---

# remove(_:using:)

Removes the specified object from the tree, using a reference to its containing node.

## Declaration

```swift
func remove(_ data: ElementType, using node: GKQuadtreeNode) -> Bool
```

## Parameters

- `data`: The object to be removed from the tree.
- `node`: The node in the tree containing the object.

## Return Value

Return Value true if the object was removed from the tree. false if the specified object or node is not in the tree.

## Discussion

Discussion By referencing the node that contains the object to remove, this method can quickly remove an object from the tree without needing to perform an exhaustive search. To make use of this performance optimization, keep a reference to the node returned when you add elements with the add(_:at:) or add(_:in:) methods.

## See Also

### Adding and Removing Elements

- [add(_:at:)](gameplaykit/gkquadtree/add(_:at:).md)
- [add(_:in:)](gameplaykit/gkquadtree/add(_:in:).md)
- [remove(_:)](gameplaykit/gkquadtree/remove(_:).md)
