Latest 1.0.2
Homepage https://github.com/yunWJR/YunImgView
License MIT
Platforms ios 9.0, requires ARC
Dependencies YunBaseApp, YunKits, Masonry, YunPmsHelper, YunImageBrowser, Mantle, TZImagePickerController
Authors

封装的 iOS 图片列表控件,用 Objective-C 编写

  • Platform: iOS 9.0 and later

需要的基本库

  • YunBaseApp

  • YunKits

  • YunImageBrowser

  • Mantle

  • TZImagePickerController

  • YunPmsHelper

主要功能

该库主要包括两部分:1)YunImgView 图片列表库。2)YunSelectImgHelper 图片视频选择库。

1. YunImgView

使用示例

    YunImgListView *imgListView = [YunImgListView new];
    imgListView.delegate = self;

    // 参数设定,具体参数参见YunImgListView
    imgListView.hasAddBtn = YES; // 是否显示添加新图片按钮,如果为 YES,最后一格为添加新图片按钮。
    imgListView.maxCount = 12; // 最多图片数,默认9
    imgListView.rowNum = 4; // 每行显示图片数量,默认3

    [self.view addSubview:imgListView];

    [imgListView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.centerY.equalTo(self.view);
        make.height.equalTo(@200);
        make.width.equalTo(self.view);
    }];

    // 设置显示的图片
    [imgListView resetImgByImgUrlList:@[@"url",@"url"]];

2. YunSelectImgHelper

1) 实现代理

以下两种代理任意实现一种。

    // 全局选择图片代理
    YunImgViewConfig.instance.delegate = self;

    // 实例选择图片代理
    YunSelectImgHelper *selectImgHelper = [YunSelectImgHelper new];
    selectImgHelper.delegate = self;

2)参数设置

图片或视频选择的参数可以在 全局YunImgViewConfig.instance设置,或者对应实例单独设置。

具体可配参数见YunImgViewConfigYunSelectImgHelper

3)选择图片

    NSInteger curCount = 0; // 已选择了图片数量,与maxCount对应。
    [selectImgHelper selectItem:curCount];

安装

Use the cocoaPods

pod 'YunImgView'

Latest podspec

{
    "name": "YunImgView",
    "version": "1.0.2",
    "summary": "yun's img list view for iOS",
    "description": "yun's imglistview for iOS",
    "homepage": "https://github.com/yunWJR/YunImgView",
    "license": "MIT",
    "authors": {
        "yun": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/yunWJR/YunImgView.git",
        "tag": "1.0.2"
    },
    "source_files": [
        "YunImgView/YunImgView.h",
        "YunImgView/class/*.{h,m}",
        "YunImgView/class/ImageEditView/*.{h,m}"
    ],
    "requires_arc": true,
    "dependencies": {
        "YunBaseApp": [],
        "YunKits": [],
        "Masonry": [],
        "YunPmsHelper": [],
        "YunImageBrowser": [],
        "Mantle": [],
        "TZImagePickerController": []
    }
}

Pin It on Pinterest

Share This