<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKNode/childNode(withName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKNode(im)childNodeWithName:"
  },
  "title" : "childNode(withName:)"
}
-->

# childNode(withName:)

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

```
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`.

## Return Value

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

## Discussion

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)