outlineItem(for:)
Returns the most likely parent PDF outline object for the selection.
Declaration
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.