一句代码保存截图,将scrollView相关的页面保存为图片,支持UIScrollView,UITableView,UICollectionView,UIWebView,WKWebView。支持iOS11
- 1、:
在Podfile文件里面添加:pod 'TYSnapshotScroll'
- 2、:对应文件添加头文件
#import "TYSnapshotScroll.h"
//在需要截图的地方调用此方法
[TYSnapshotScroll screenSnapshot:yourView finishBlock:^(UIImage *snapShotImage) {
doSomething
}];
- 1、引入头文件:
#import "TYSnapshotScroll.h"
- 2、使用以下方法
//在需要截图的地方调用此方法
[TYSnapshotScroll screenSnapshot:yourView finishBlock:^(UIImage *snapShotImage) {
doSomething
}];