What problem does it solve?
Provide clear, actionable guidance for displaying, navigating, searching, annotating, and programmatically manipulating PDF documents in iOS apps using PDFKit so developers avoid common pitfalls with PDFView, PDFDocument, and annotation coordinate systems.
Core Features & Use Cases
- Rendering & Navigation: Configure PDFView display modes, scaling, history navigation, and page destinations for smooth reading experiences.
- Text Search & Extraction: Find strings synchronously or asynchronously, extract page or region text, and highlight search results for reader interaction and indexing.
- Annotations & Forms: Create, add, remove, and burn-in annotations; fill form widgets, handle widget state, and implement custom annotation subclasses for stamps or interactive widgets.
- Integration Patterns: Wrap PDFView in SwiftUI via UIViewRepresentable, implement coordinator patterns for page tracking and annotation hit detection, and generate thumbnails or render pages to images for previews.
Quick Start
Open the PDFDocument from a file URL and assign it to a PDFView configured with autoScales and an appropriate displayMode, or wrap that PDFView in a UIViewRepresentable to show it inside SwiftUI.