---
title: "childNode(withName:)"
framework: spritekit
role: symbol
role_heading: Instance Method
path: "spritekit/sknode/childnode(withname:)"
---

# childNode(withName:)

Searches the children of the receiving node for a node with a specific name.

## Declaration

```swift
func childNode(withName name: String) -> SKNode?
```

## Parameters

- `name`: The name to search for. This may be either the literal name of the node or a customized search string. See Searching the Node Tree.

## Mentioned in

Searching the Node Tree

## Return Value

Return Value If a node object with that name is found, the method returns the node object. Otherwise, it returns nil.

## Discussion

Discussion If more than one child share the same name, the first node discovered is returned.

## See Also

### Accessing Nodes by Name

- [Searching the Node Tree](spritekit/searching-the-node-tree.md)
- [name](spritekit/sknode/name.md)
- [enumerateChildNodes(withName:using:)](spritekit/sknode/enumeratechildnodes(withname:using:).md)
- [subscript(_:)](spritekit/sknode/subscript(_:).md)
