前言:TZImagePickerController 是非常优秀的获取系统图片的第三方库,为了方便调用,本人封装了一个工具TZImagePickerHelper。
- 控制器中初始化一个helper
_helper = [[TZImagePickerHelper alloc] init];
- 调用helper中方法 showImagePickerControllerWithMaxCount
[self.helper showImagePickerControllerWithMaxCount:(MAX_COUNT - self.imagesURL.count) WithViewController:self];
- block回调数据,刷新界面显示
WeakPointer(weakSelf);
_helper.finish = ^(NSArray *array){
[weakSelf.imagesURL addObjectsFromArray:array];
weakSelf.layout.itemCount = weakSelf.imagesURL.count;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.collectionView reloadData];
});
};
网友评论