I had to change the navigation under certain circumstances, and due to the complexity of the transitions, I took the paint and screenshot until the transition was complete. In almost cases, this works very well, but there is a moment that bothers me. I have a view controller with two select views:

But the screenshot does not work well on this VC. I get the following:

In both cases, a code is used that takes a screenshot:
- (UIImage *)takeScreenshot {
CALayer *layer = [[UIApplication sharedApplication] keyWindow].layer;
UIGraphicsBeginImageContext(layer.frame.size);
[layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();
return screenshot;
}
Does anyone know how this could happen?
source
share