When we get a screenshot of a UIView, we use this code usually:
UIGraphicsBeginImageContextWithOptions(frame.size, false, scale)
drawViewHie
I solved this problem by putting image operations in another queue!
private func processImage(image: UIImage, size: CGSize, completion: (image: UIImage) -> Void) {
dispatch_async(dispatch_get_global_queue(Int(QOS_CLASS_USER_INITIATED.rawValue), 0)) {
UIGraphicsBeginImageContextWithOptions(size, true, 0)
image.drawInRect(CGRect(origin: CGPoint.zero, size: size))
let tempImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
completion(image: tempImage)
}
}