2

In iOS 12.2, passing true to PDFView's usePageViewController(_, withViewOptions:) will cause a crash with the following exception:

*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]'

The same code works fine on iOS 12.1. I also have other projects that do this and those projects do work on iOS 12.2, but their view controller hierarchy is quite a bit more complicated.

Is there possibly something I'm missing, or should I file a bug report with Apple?

I have created a tiny project on github which demonstrates the crash at https://github.com/rudedogdhc/crash-pdfview-ios12.2

Rudedog
  • 4,323
  • 1
  • 23
  • 34
  • Why would I want to comment that line? That just gives me a black screen because the app no longer has a window. – Rudedog Mar 26 '19 at 21:17

1 Answers1

1

Try moving usePageViewController(_, withViewOptions:) (and everything else you're setting up with it for that matter) into viewDidAppear instead of viewDidLoad

I ran into the same problem and found the answer here: There's problem with PDFKit appeared after update to Xcode 10.2. Is there any way to solve?

Vegepilot
  • 98
  • 1
  • 8