TYSnapshotScroll将scrollView相关的页面保存为图片,支持UIScrollView,UITableView,UIWebView,WKWebView。
1、引入头文件:
#import 'UIScrollView+TYSnapshot.h'2、使用以下方法
[UIScrollView setTYSnapshotDebugLog:YES]; UIImage * snapshotImg = [UIScrollView getSnapshotImage:self.webView.scrollView];<mark>注意:</mark>
方法
+(UIImage *)getSnapshotImage:(UIScrollView *)scrollView;scrollView为对应的scrollView,比如UIWebView传入webView.scrollView
github地址:https://github.com/TonyReet/TYSnapshotScroll