以下代码我在ios 10中应用,这完美无缺。但是当ios 11出现时,它会自动保存所有屏幕截图,不允许忽略即时标记截图。
for (int k = 0; k<[imgAry count]; k++) {
UIGraphicsBeginImageContextWithOptions(imgBaseView.bounds.size, NO, [UIScreen mainScreen].scale);
[imgBaseView drawViewHierarchyInRect:imgBaseView.boundsafterScreenUpdates:YES];
[imgBaseView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGImageDestinationAddImage(destination, image.CGImage, (__bridge
CFDictionaryRef)frameProperties);
}