Latest 0.1.3
Homepage https://github.com/duyulong12/YLImageBrower
License LICENSE.txt
Platforms ios 8.0, requires ARC
Frameworks Foundation, UIKit
Authors

集成非常方便的图片浏览器,只需要实现一个Datasource方法提供URL数组就Ok,同时默认集成3DTouch功能,并增加过渡动画优化体验。(全代码NSLayoutConstraint约束布局,内置图片本地缓存。无需依赖Masonry与SDWebImage。)

怎么使用?

使用 Cocoapods:

pod 'YLImageBrower' 

引入头文件 :

#import "YLImageBrower.h"

使用方法

创建YLImageBrowerListVC实例并实现其datasrouce协议YLImageBrowerListDataSource中的方法。

@required
- (NSArray<NSString *> *)yl_imageBrowerListItems;//图片URL的数据源,请务必实现
@optional
- (UIImage *)yl_imageBrowerPlaceholderImage;//图片下载之前的占位图,可选实现

示例

  YLImageBrowerListVC *vc = [[YLImageBrowerListVC alloc]init];
  vc.datasource = self;

  //设置placeholder()
-(UIImage *)yl_imageBrowerPlaceholderImage {
    return [UIImage imageNamed:@"placeholder"];
}

//设置数据源
-(NSArray<NSString *> *)yl_imageBrowerListItems {
    return @[
             @"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1497338920738&di=3cc53fb8094f6a01fef4aa85a8eb0e3a&imgtype=0&src=http%3A%2F%2Fimgsrc.baidu.com%2Fimgad%2Fpic%2Fitem%2Fb03533fa828ba61e5e6d4c0d4b34970a304e5915.jpg",
             @"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1497338920738&di=288a11b1762eda31dded4642d172ed10&imgtype=0&src=http%3A%2F%2Fpic15.photophoto.cn%2F20100615%2F0006019058815826_b.jpg",
             ];
}

运行演示

Latest podspec

{
    "name": "YLImageBrower",
    "version": "0.1.3",
    "summary": "it is image brower",
    "license": "LICENSE.txt",
    "homepage": "https://github.com/duyulong12/YLImageBrower",
    "authors": {
        "duyulong12": "[email protected]"
    },
    "source": {
        "git": "https://github.com/duyulong12/YLImageBrower.git",
        "tag": "0.1.3"
    },
    "requires_arc": true,
    "source_files": "YLImageBrower/**/*",
    "platforms": {
        "ios": "8.0"
    },
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This