用于取代iOS SDK 的 UIImagePickerController,支持多选。基于 ALAsset实现,兼容iOS 6 +。O-C 框架。支持本地化(英文、简体中文、繁体中文)。
一、 项目地址
二、 使用
拷贝ZCImagePickerController目录到你的项目。在O-C桥接头文件中加入:
#import "ZCImagePickerController.h"
在ViewController中实现ZCImagePickerControllerDelegate协议:
extension ImagePickerController: ZCImagePickerControllerDelegate{
// MARK:- ZCImagePickerControllerDelegate
func zcImagePickerController(imagePickerController: ZCImagePickerController!, didFinishPickingMediaWithInfo info: [AnyObject]!) {
self.dismissViewControllerAnimated(true){ () -> Void in
var images = [UIImage]()
for imageDic:NSDictionary in info as! [NSDictionary]{
if let image=imageDic[UIImagePickerControllerOriginalImage] as? UIImage{
images.append(image)
}
}
self.delegate?.returnValue(images, from: self)
}
}
func zcImagePickerControllerDidCancel(imagePickerController: ZCImagePickerController!) {
self.dismissViewControllerAnimated(true, completion: nil)
}
}