Crash with PDFKit on iOS 12.2

你离开我真会死。 提交于 2019-12-02 02:29:13

问题


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


回答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?



来源:https://stackoverflow.com/questions/55362761/crash-with-pdfkit-on-ios-12-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!