<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSViewController/removeChild(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSViewController(im)removeChildViewControllerAtIndex:"
  },
  "title" : "removeChild(at:)"
}
-->

# removeChild(at:)

Removes a specified child controller from the view controller.

```
func removeChild(at index: Int)
```

## Parameters

`index`

The index in the [`children`](/documentation/AppKit/NSViewController/children) array for the child view controller you want to remove.

## Discussion

Override this method if you want to perform work during the removal of a child view controller. If you do override this method, in your implementation call this method on `super`.

If you just want to remove a child view controller, instead use the [`removeFromParent()`](/documentation/AppKit/NSViewController/removeFromParent()) method

---

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)