I create and display a custom view with the code snippet below. It was running smoothly before Xcode 11.4. Although it works while debugging at Xcode 11.4, the view does not occur when I upload it to testfligt. Has anyone experienced such a problem?
if UIScreen.main.responds(to: #selector(getter: UIScreen.main.scale)) {
UIGraphicsBeginImageContextWithOptions(vView.frame.size, false, UIScreen.main.scale)
} else{
UIGraphicsBeginImageContext(vView.frame.size)
}
vView.layer.render(in: UIGraphicsGetCurrentContext()!)
vView.setNeedsDisplay() // add this and solve problem
let imageR = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return imageR