uxmstudio / UXMPDFKit

An iOS PDF viewer and annotator written in Swift that can be embedded into any application.
MIT License
275 stars 103 forks source link

Crash For iPhone 6s #90

Open look416 opened 5 years ago

look416 commented 5 years ago

iPhone 6s will crash when trying to load the documents under vertical orientation.

Using storyboard method VC, set the flow direction for the collection view to be vertical.

under UICollectionViewDelegateFlowLayout->section vertical the contentViewSize.width is 464.000000006 and the bounds.width is 464 By doing comparison between two value which equates to false and hence will go to fatal error.

You can refer to PDFSinglePageViewer.swift -> Line 172

Surprisingly, this only happens to iPhone 6s, it works will with my iPhone X and iPhone 4.

My suggestion would be by flooring the value for contextViewSize before comparing the value with bounds.