{"id":20098860,"url":"https://github.com/imwcl/wclimagepickercontroller","last_synced_at":"2025-12-12T06:03:55.000Z","repository":{"id":56926243,"uuid":"78541522","full_name":"imwcl/WCLImagePickerController","owner":"imwcl","description":"可自定义的图片选择器","archived":false,"fork":false,"pushed_at":"2017-05-16T16:00:10.000Z","size":1099,"stargazers_count":52,"open_issues_count":3,"forks_count":16,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-31T15:51:00.318Z","etag":null,"topics":["imagepicker","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imwcl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-10T14:33:44.000Z","updated_at":"2022-10-29T07:13:41.000Z","dependencies_parsed_at":"2022-08-20T22:50:31.513Z","dependency_job_id":null,"html_url":"https://github.com/imwcl/WCLImagePickerController","commit_stats":null,"previous_names":["631106979/wclimagepickercontroller"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imwcl%2FWCLImagePickerController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imwcl%2FWCLImagePickerController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imwcl%2FWCLImagePickerController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imwcl%2FWCLImagePickerController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imwcl","download_url":"https://codeload.github.com/imwcl/WCLImagePickerController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224490723,"owners_count":17319983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["imagepicker","swift"],"created_at":"2024-11-13T17:06:55.916Z","updated_at":"2025-12-12T06:03:54.992Z","avatar_url":"https://github.com/imwcl.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# WCLImagePickerController\n\n![](https://img.shields.io/badge/Swift-3.0-blue.svg?style=flat)\n[![Version](https://img.shields.io/cocoapods/v/WCLImagePickerController.svg?style=flat)](http://cocoapods.org/pods/WCLImagePickerController)\n[![Platform](https://img.shields.io/cocoapods/p/WCLImagePickerController.svg?style=flat)](http://cocoapods.org/pods/WCLImagePickerController)\n[![License](https://img.shields.io/cocoapods/l/WCLImagePickerController.svg?style=flat)](http://cocoapods.org/pods/WCLImagePickerController)\n\n`WCLImagePickerController`是一个自定义的图片选择器\n\n![wcl.gif](wcl.gif)\n\n# Demo\n\n可以通过[Appetize.io](https://appetize.io/app/hue1a1gmunhh46dtcxuj8ycfd4?device=iphone5s\u0026scale=75\u0026orientation=portrait\u0026osVersion=9.3)运行我的Demo，非常方便~\n\n# **Features**\n\n- [x] 支持多选图片\n- [x] 支持图片预览\n- [x] 可以高度自定义界面，包括颜色和其他功能\n- [x] 支持拍照功能\n- [x] 支持本地化（中、英）\n\n# 安装\n\n必须iOS 8.0+ Swift3\n\n## CocoaPods\n\n如果没有安装你可以用下面的命令安装[CocoaPods](http://cocoapods.org)：\n\n```shell\n$ gem install cocoapods\n```\n\n使用CocoaPods将`WCLImagePickerController`添加到您的`Xcode`项目，在`Podfile`中添加一下代码：\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '8.0'\nuse_frameworks!\n\npod 'WCLImagePickerController'\n```\n\n然后，运行以下命令：\n\n```shell\n$ pod install\n```\n\n# 使用\n\n首先因为权限问题需要加入照片权限和摄像头的权限：\n\n在项目的`info.plist`添加一下字段\n\n`NSPhotoLibraryUsageDescription`和`NSCameraUsageDescription`\n\n可以下载项目查看demo：\n\n```swift\n// 推出WCLImagePickerController\nWCLImagePickerController.present(inVC: self, delegate: self)\n\n// 实现代理\nfunc wclImagePickerCancel(_ picker: WCLImagePickerController) {\n    picker.dismiss(animated: true, completion: nil)\n}\n    \nfunc wclImagePickerComplete(_ picker: WCLImagePickerController, imageArr: [UIImage]) {\n   picker.dismiss(animated: true, completion: nil)\n}\n    \nfunc wclImagePickerError(_ picker: WCLImagePickerController, error: WCLError) {\n    let al = UIAlertController.init(title: nil, message: error.lcalizable, preferredStyle: .alert)\n    let cancel = UIAlertAction.init(title: WCLImagePickerBundle.localizedString(key: \"取消\"), style: .cancel, handler: nil)\n    al.addAction(cancel)\n    self.vc?.present(al, animated: true, completion: nil)\n }\n```\n\n# 自定义\n\n以下属性都是可以自定义的，下面是一下默认的配置\n\n```swift\npublic struct WCLImagePickerOptions {\n    //字体设置，默认苹方字体\n    static var fontLightName: String   = \"PingFangSC-Light\"\n    static var fontRegularName: String = \"PingFangSC-Regular\"\n    static var fontMediumName: String  = \"PingFangSC-Medium\"\n    \n    //MARK: 图片选择器的选项\n    //是否需要拍照功能\n    static var needPickerCamera: Bool  = true\n    //相册页每行的照片数，默认每行3张\n    static var photoLineNum: Int       = 3\n    //相册选择页照片的间隔，默认3，最小为2\n    static var photoInterval: Int      = 3\n    //相册选择器最大选择的照片数\n    static var maxPhotoSelectNum: Int  = 9\n    //是否显示selectView\n    static var isShowSelecView: Bool   = true\n    \n    //MARK: launchImage的配置\n    //相册启动图片和启动颜色，二选一，launchImage优先级高\n    static var launchImage: UIImage?   = nil\n    //没有设置默认用imageTintColor\n    static var launchColor: UIColor?   = nil\n    \n    //MARK: 状态栏的样式\n    static var statusBarStyle: UIStatusBarStyle = .lightContent\n    \n    //MARK: 图片的配置\n    static var imageBuffer: UIImage?        = WCLImagePickerBundle.imageFromBundle(\"image_buffer\")\n    static var ablumSelectBackGround: UIImage?   = WCLImagePickerBundle.imageFromBundle(\"image_ablumSelectBackGround\")\n    static var cameraImage: UIImage?   = WCLImagePickerBundle.imageFromBundle(\"image_camera\")\n    static var pickerArrow: UIImage?   = WCLImagePickerBundle.imageFromBundle(\"image_pickerArrow\")\n    static var pickerDefault: UIImage? = WCLImagePickerBundle.imageFromBundle(\"image_pickerDefault\")\n    static var selectPlaceholder: UIImage? = WCLImagePickerBundle.imageFromBundle(\"image_selectPlaceholder\")\n    \n    //MARK: 颜色的配置\n    static var tintColor: UIColor       = UIColor(red: 49/255, green: 47/255, blue: 47/255, alpha: 1)\n    //没有设置默认用imageTintColor\n    static var pickerSelectColor: UIColor?   = UIColor(red: 255/255, green: 0/255, blue: 27/255, alpha: 1)\n    //没有设置默认用imageTintColor\n    static var selectViewBackColor: UIColor? = nil\n}\n```\n\n# blog\n\n[photos框架的相关介绍](http://blog.csdn.net/wang631106979/article/details/54343860)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimwcl%2Fwclimagepickercontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimwcl%2Fwclimagepickercontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimwcl%2Fwclimagepickercontroller/lists"}