# chImageBrower **Repository Path**: Cyptt/ch-image-brower ## Basic Information - **Project Name**: chImageBrower - **Description**: oc框架的图片预览 内部使用image框架 - **Primary Language**: Objective-C - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-06-24 - **Last Updated**: 2023-07-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # chImageBrower ##导入项目 pod 'CHImageBrower' ## 依赖第三方库SDWebImage ## 使用 ### ``` #import #import "CHImageBrowser.h" NSMutableArray *images = [[NSMutableArray alloc] init]; for (int i = 0; i < self.datum.count; i ++) { NSString *imageString = self.datum[i]; NSIndexPath *index = [NSIndexPath indexPathForRow:i inSection:0]; UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:index]; CHImageBrowserModel *model = [[CHImageBrowserModel alloc] initWithURL:[NSURL URLWithString:imageString] toView:cell]; [images addObject:model]; } CHImageBrowser *vc = [[CHImageBrowser alloc] init]; vc.images = images; vc.index = indexPath.row; [self presentViewController:vc animated:NO completion:nil]; [vc setPageControlBlock:^(CHImageBrowerPageControl * _Nonnull pageControl) { pageControl.pageIndicatorTintColor = [UIColor redColor]; pageControl.hidden = NO; //YES 则是隐藏 }]; ```