PDFView's effectiveAppearance not updated when switching to dark mode

255 Views Asked by At

PDFKit's PDFView seems to not be compatible with dark mode. It's effectiveAppearance does not get updated when user switches to dark mode.

override public func updateLayer() {
    print("mode = \(effectiveAppearance.name)")
    super.updateLayer()
}
// even in dark mode, always prints: mode = NSAppearanceName(_rawValue: NSAppearanceNameAqua)

Is there any reason for that? Any elegant workaround to change PDFView's background color with dark mode?

0

There are 0 best solutions below