简单易用的图片浏览器
这是一款轻量级的图片浏览器demo,效果类似京东淘宝等购物app的商品图片浏览,使用只需要几步很简单的操作:设置图片数组,图片类型和图片索引即可。调用代码如下: #pragma mark - 单击跳转 - (void)browseImage:(UITapGestureRecognizer *)tap { YLPhotoBrowser * browser = [[YLPhotoBrowser alloc] init]; browser.imageArray = _imgArray;//图片数组 browser.imageType = ImageType_Str;//图片类型 browser.currentIndex = _index;//当前图片索引 //回调block(做你想做的操作) browser.dismissBlock = ^(NSInteger dismissIndex){ _scrollView.contentOffset = CGPointMake(dismissIndex * SCREEN_WIDTH, 0); _pageControl.currentPage = dismissIndex; }; [self presentViewController:browser animated:NO completion:nil]; }