Alua-Kinzhebayeva / iOS-PDF-Reader

PDF Reader for iOS written in Swift
MIT License
533 stars 150 forks source link

Bug 64 - Accessing UIKit from background queue #67

Closed jwelton closed 6 years ago

jwelton commented 6 years ago

This fixes #64 was caused by us accessing the view bounds from a background queue. The draw(_ layer: CALayer, in con: CGContext) method is called on a background queue. UIKit must always be accessed from the main queue. When we fetch the bounds for filling the background and fixing the rotation, we failed to conform to this rule.

This PR fixes this issue by firstly fetching the bound on the main queue.

ranunez commented 6 years ago

This looks great! Thanks for the contribution!!