I am trying to take a screenshot of an ArcGIS map view programmatically. I haven't seen any code in the ArcGIS library to make this easy. I'm really trying to create a UIImage of the map view including any feature layers that are currently being displayed. I tried using UIGraphicsBeginImageContext for the arcgisMapView and on the superview containing the arcgisMapView, but both attempts return a blank view for the arcgisMapView area.
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *mapImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(mapImage, nil, nil, nil);
and
UIGraphicsBeginImageContext(arcgisMapView.bounds.size);
[arcgisMapView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *mapImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(mapImage, nil, nil, nil);
Please help and thanks.