I'm having trouble using PDFKit in my application. I have a table cell in which I'm trying to render a PDF using PDFKit. I'm able to load/render the PDF, but what's happening is the PDF is clear at the top but as you scroll down it becomes blurry.
See below (yes, TextEdit is over the screen shot, just using it to block content):
As you can see, the PDF gets unreadable as you get lower.
Here's my relevant code:
containerView.addSubview(documentView)
fileprivate lazy var documentView: PDFView = {
let view = PDFView();
view.translatesAutoresizingMaskIntoConstraints = false
if let document = PDFDocument(url: url) {
view.document = document
}
view.autoScales = true;
view.isHidden = false
return view
}()
And I also set constraints:
let margin: CGFloat = 30
containerView.addConstraints([
spinnerView.centerXAnchor.constraint(equalTo: containerView.centerXAnchor),
spinnerView.centerYAnchor.constraint(equalTo: containerView.centerYAnchor),
documentView.topAnchor.constraint(equalTo: containerView.topAnchor, constant: 0),
documentView.leadingAnchor.constraint(equalTo: containerView.leadingAnchor, constant: margin),
documentView.trailingAnchor.constraint(equalTo: containerView.trailingAnchor, constant: -margin),
documentViewBottomConstraint
])
Any ideas what's going on? Thanks!