I'm trying to programmatically take a snapshot of a Group element and its contents (a text label) and save it to the camera roll.
I would usually do something like this (see code snippet) for an iPhone app but with WatchKit the Group element has a different structure to a UIView.
Any help would be much appreciated. Here's my code:
// grab reference to the area you'd like to capture
WKInterfaceGroup *theArea = _theGroup;
// define the size and grab a UIImage from it
UIGraphicsBeginImageContextWithOptions(theArea.bounds.size, theArea.opaque, 0.0);
[theArea.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screengrab = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
// save screengrab to Camera Roll
UIImageWriteToSavedPhotosAlbum(screengrab, nil, nil, nil);