截图

UIGraphicsBeginImageContextWithOptions(self.imgView.bounds.size, YES, [UIScreen mainScreen].scale);

    [self.imgView drawViewHierarchyInRect:self.imgView.bounds afterScreenUpdates:YES];

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

原文地址:https://www.cnblogs.com/bing-ge/p/4831346.html