<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PDFKit",
  "identifier" : "/documentation/PDFKit/PDFDocument/outlineItem(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PDFKit"
    ],
    "preciseIdentifier" : "c:objc(cs)PDFDocument(im)outlineItemForSelection:"
  },
  "title" : "outlineItem(for:)"
}
-->

# outlineItem(for:)

Returns the most likely parent PDF outline object for the selection.

```
func outlineItem(for selection: PDFSelection) -> PDFOutline?
```

## Parameters

`selection`

The area of the document currently selected by the user. A selection can span multiple outline items, but only the point representing the first character is considered.

## Return Value

The PDF outline object that is the most likely parent of the specified selection. Note that only the point representing the first character of the selection is considered in this method.

## Discussion

Typically, outlines represent structural items such as chapters. You can use this method to identify the chapter that a selection falls within.

---

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)