iOS截屏

- (UIImage *)captureImageFromView:(UIView *)view{
    
    UIGraphicsBeginImageContext(view.bounds.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    [view.layer renderInContext:context];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return image;
}
原文地址:https://www.cnblogs.com/chanjinger/p/6004199.html