废话少哔哔,直接上代码
-(UIImage *)captureScreenForView:(UIView *)currentView {
UIGraphicsBeginImageContext(currentView.frame.size);
[currentView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return viewImage;
}