pdfkit
Installation
SKILL.md
PDFKit (iOS)
Render, navigate, annotate, search, and fill PDFs. import PDFKit. iOS 11+;
this skill targets the iOS 26 era. PDFKit is UIKit-based — there is no native
SwiftUI PDFView, so wrap it with UIViewRepresentable (see swiftui-uikit-interop).
- Threading:
PDFViewand all UI live on the main thread. Loading a largePDFDocument, rendering thumbnails, andwrite(to:)are expensive — run them off the main actor and hand the finished object back to the view. - Fintech note: never write account statements/receipts to a world-readable path.
Export to an app-sandbox URL and, if it leaves the device or persists, encrypt at
rest — see
swift-security. PDFKit's own owner/user passwords (below) are AcroForm encryption, not a substitute for file-level protection.