<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PDFKit",
  "identifier" : "/documentation/PDFKit/PDFOutline/insertChild(_:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PDFKit"
    ],
    "preciseIdentifier" : "c:objc(cs)PDFOutline(im)insertChild:atIndex:"
  },
  "title" : "insertChild(_:at:)"
}
-->

# insertChild(_:at:)

Inserts the specified outline object at the specified index.

```
func insertChild(_ child: PDFOutline, at index: Int)
```

## Discussion

To build a PDF outline hierarchy, use this method to add child outline objects. Before you call this method on a `PDFOutline` object that already has a parent, you should retain the object and call [`removeFromParent()`](/documentation/PDFKit/PDFOutline/removeFromParent()) on it first.

## See Also

[`child(at:)`](/documentation/PDFKit/PDFOutline/child(at:))

Returns the child outline object at the specified index.



---

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)