I'm displaying PDF files in an iOS / Mac Catalyst app with PDFView. My app has had a dark color theme since long before Apple added Dark Mode to its operating systems, but now that Apple supports this, I'm thinking it should be possible to display the PDFView with a Dark Mode (inverted colors, with white text on a dark background) to match the rest of the app. However, I haven't found a way. Here's what I've tried:
PDFView *pdfView = [[PDFView alloc] init];
pdfView.overrideUserInterfaceStyle = UIUserInterfaceStyleDark; // no effect
pdfView.tintColor = [UIColor blackColor]; // no effect; also tried whiteColor
I found the PDFAppearanceCharacteristics
class, and that offers a way to change the PDF background color, but I'd need to change the text and any shape objects, too. (I'm not worried about photos in PDFs, because that doesn't typically occur with my app.) I also checked the PDFDocument
and PDFPage
classes, but they don't seem to offer anything like this.
I was kind of hoping this would just follow the operating system's Dark Mode automatically, but I'm surprised there's not at least some way to override the colors. Is there an option I'm missing?