Why would does this work on simulator but not on a device.
I am trying to capture a screenshot of a view that contains more than one AVPlayer.I can snap a frame from a player, but I need the actual screenshot as the view contains a few players, in specific locations on the screen at once.
There are multiple threads regarding this topic, but I am yet to find an answer.
- (UIImage *) takeScreenShot
{
UIImage *image;
CGSize snapArea = self.view.bounds.size;
int bottomTobBarHeight = 44;
snapArea.height = snapArea.height - bottomTobBarHeight;
UIGraphicsBeginImageContextWithOptions(snapArea, YES, 1.0);
[self.view drawViewHierarchyInRect:self.view.bounds afterScreenUpdates:YES];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}