Updated
I\'m using the sinch library to make video call in my app. I\'ve button to take screenshot for the whole screen during the video call :
To solve this issue, I'had to switch the video call camera from back to front camera so that user could user the back camera to take photo, once he done with taking photo I switch back the video call to back camera.
Well I usually use this code if I want to trigger a simple screenshot:
static func screenshotOf(window: UIWindow) -> UIImage? {
UIGraphicsBeginImageContextWithOptions(window.bounds.size, true, UIScreen.main.scale)
guard let currentContext = UIGraphicsGetCurrentContext() else {
return nil
}
window.layer.render(in: currentContext)
guard let image = UIGraphicsGetImageFromCurrentImageContext() else {
UIGraphicsEndImageContext()
return nil
}
UIGraphicsEndImageContext()
return image
}
I guess that should work for your issue as well