Latest 1.0.6
Homepage https://github.com/Xiexingda/XDPicLibrary
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

一个自定义图片选择器

使用方法:

1 引入头文件

import "XDPicLibrary.h"

2 在点击事件里面进行跳转

  • (void)buttonSelected {

XDPicLibrary root = [[XDPicLibrary alloc]initBackInfo:^(NSMutableArray assets) {

/*

assets 为图片资源组 不是直接的Image,如果用Image 的话需要 转换,转换方法:

imageAsset = assets[index];

1.

//获取大图资源

ALAssetRepresentation *presentation = [imageAsset defaultRepresentation];

//大图

CGImageRef original =

This slideshow could not be started. Try refreshing the page or viewing it in another browser.

;

//image

UIImage *originalImage = [UIImage imageWithCGImage:original];

2.

//获取缩略图

CGImageRef thumbnail = [itemAsset thumbnail];

//转为image

UIImage *image = [UIImage imageWithCGImage:thumbnail];

*/

}];

//设置一次性选择的最大张数

root.maxNumber = 1;

//设置图片

// [root setImage:nil selectedImage:[UIImage imageNamed:nil]];

//设置选中按钮的选中前 & 选中后的颜色

// [root setColor:[UIColor clearColor] selectedColor:[UIColor blueColor]];

//设置选中按钮的边框颜色

// [root setMarkBorderColor:[UIColor whiteColor]];

/*

由于笔者比较懒,懒得再去弄navBar的东西,当前只能push过去,如果想present过去的话,需要自行实现

XDPicLibrary的navBar,并把左右按钮的点击事件对应起来就OK了

*/

[self.navigationController pushViewController:root animated:YES];

}

Latest podspec

{
    "name": "XDPicLibrary",
    "version": "1.0.6",
    "summary": "u56feu7247u9009u62e9u5668",
    "description": "u4e00u4e2au81eau5b9au4e49u5c01u88c5u7684u53efu4ee5u9884u89c8u7684u56feu7247u9009u62e9u5668",
    "homepage": "https://github.com/Xiexingda/XDPicLibrary",
    "license": "MIT",
    "authors": {
        "xiexingda": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Xiexingda/XDPicLibrary.git",
        "tag": "1.0.6"
    },
    "source_files": "XDPicLibrary/*.{h,m}",
    "exclude_files": "XDPicLibrary/Exclude",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This