I took screenshot of overlay image with background camera controller. But background cameracontroller layer is hiding when taking picture
code:
CGRect rect = [previewView bounds];
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[previewView.layer renderInContext:context];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(img, nil, nil, nil);