Using C Libraries in Modern Apps
summary
Explains how pdfium gets integrated into AsdeqDocs by wrapping its C API in Swift: creates a pdfium Swift framework that exposes only Swift wrappers while importing C headers via a module map and bridging header, compiles static .a libraries for arm and x86 to avoid rebuilding, and uses Swift objects with strong parent references to guarantee correct deallocation order. Demonstrates rendering annotated PDFs correctly and using C, Objective‑C, Swift and C++ together in production.
AI-written summary · about
chapters (18)
- 0:00Intro
- 1:14A talk in three parts
- 2:51PDF annotations
- 3:27Annotations with Core Graphics
- 3:55Proprietary libraries
- 5:24Pdfium to the rescue
- 7:00Annotations with pdfium
- 7:32The pdfiumswift framework
- 9:01Object-oriented pdfium
- 10:44Loading a document
- 11:18Initialising a C resource
- 12:07Automatic resource closing
- 13:33Mixing languages
- 18:32Adding C code directly
- 22:51Framework with Swift wrapper
- 27:58Dealing with pdfium
- 28:26Summary
- 28:59Questions?
