heyode / Hephotopicker
Licence: mit
自由定制支持视频,图片的相册选择器
Stars: ✭ 146
Projects that are alternatives of or similar to Hephotopicker
Flutter photo
Pick image/video from album by flutter. Support ios and android. UI by flutter, no native.
Stars: ✭ 285 (+95.21%)
Mutual labels: image, photos, picker
Flutter photo manager
Provide flutter with the ability to manage photos.
Stars: ✭ 294 (+101.37%)
Mutual labels: image, photos, picker
Fmphotopicker
A modern, simple and zero-dependency photo picker with an elegant and customizable image editor
Stars: ✭ 428 (+193.15%)
Mutual labels: image, photos, picker
Pictureselectorlight
Picture Selector Library for Android or 图片选择器
Stars: ✭ 145 (-0.68%)
Mutual labels: image, photos
Insgallery
📸 Instagram-like image picker for Android (一款 UI 炫酷高仿 Instagram 的图片、视频选择器)
Stars: ✭ 409 (+180.14%)
Mutual labels: photos, picker
Android Multipicker Library
Android Multipicker Library
Stars: ✭ 425 (+191.1%)
Mutual labels: photos, picker
Rxpaparazzo
RxJava extension for Android to take images using camera and gallery and pick files up
Stars: ✭ 467 (+219.86%)
Mutual labels: photos, picker
React Native Syan Image Picker
React-Native 多图片选择 支持裁剪 压缩
Stars: ✭ 556 (+280.82%)
Mutual labels: image, picker
Flickrsync
A command line tool to synchronise, upload, download, pictures between the local file system and Flickr. Image hash signature of the picture is used to uniquely identify the image.
Stars: ✭ 14 (-90.41%)
Mutual labels: image, photos
Zlphotobrowser
Wechat-like image picker. Support select normal photos, videos, gif and livePhoto. Support edit image and crop video. 微信样式的图片选择器,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑图片/视频,支持多语言国际化等功能;
Stars: ✭ 3,962 (+2613.7%)
Mutual labels: photos, picker
Assetspickerviewcontroller
Powerfully Customizable - Multiple Photo & Video Picker Controller
Stars: ✭ 321 (+119.86%)
Mutual labels: image, picker
React Viewer
react image viewer, supports rotation, scale, zoom and so on
Stars: ✭ 502 (+243.84%)
Mutual labels: image, photos
Bottomsheet Imagepicker
Modern image picker for Android
Stars: ✭ 267 (+82.88%)
Mutual labels: image, picker
Louvre
A small customizable library useful to handle an gallery image pick action built-in your app. 🌄🌠
Stars: ✭ 629 (+330.82%)
Mutual labels: image, picker
Picker
Picker - A CameraX based WhatsApp Style Image-Video Picker
Stars: ✭ 69 (-52.74%)
Mutual labels: image, picker
HEPhotoPicker
功能
- [x] 支持选择视频和图片(可自定义)
- [x] 支持预览大图
- [x] 支持累加选择
- [x] 可切换相册
- [x] 可设置视频和图片最大选择个数
- [x] 支持图片单选
- [x] 可定制为微博相册选择器
系统要求
- iOS 9.0
- Xcode 10
- Swift 4.2
安装
使用CocoaPods安装,添加以下内容至你的Podfile
pod 'HEPhotoPicker'
在终端运行pod install
或pod update
使用
使用前需要在使用项目的info.plist文件中加上用户授权相册的描述Privacy - Photo Library Usage Description
导入HEPhotoPicker
import HEPhotoPicker
实现代理
实现HEPhotoPickerViewControllerDelegate
代理回调方法,处理选中的图片视频数据
func pickerController(_ picker: UIViewController, didFinishPicking selectedImages: [UIImage], selectedModel: [HEPhotoAsset])
弹出相册选择器,使用默认配置
// 创建选择器
let picker = HEPhotoPickerViewController.init(delegate: self)
// 弹出
hePresentPhotoPickerController(picker: picker, animated: true)
类似微博的相册选择器
// 配置项
let option = HEPickerOptions.init()
// 只能选择一个视频
option.singleVideo = true
// 图片和视频只能选择一种
option.mediaType = .imageOrVideo
// 将上次选择的数据传入,表示支持多次累加选择,
option.defaultSelections = self.selectedModel
// 选择图片的最大个数
option.maxCountOfImage = 9
// 创建选择器
let picker = HEPhotoPickerViewController.init(delegate: self, options: option)
// 弹出
hePresentPhotoPickerController(picker: picker, animated: true)
多选图片
// 配置项
let option = HEPickerOptions.init()
// 图片和视频只能选择一种
option.mediaType = .image
// 创建选择器
let picker = HEPhotoPickerViewController.init(delegate: self, options: option)
// 弹出
hePresentPhotoPickerController(picker: picker, animated: true)
单选图片
// 配置项
let option = HEPickerOptions.init()
// 只能选择一个图片
option.singleImage = true
// 图片和视频只能选择一种
option.mediaType = .image
// 创建选择器
let picker = HEPhotoPickerViewController.init(delegate: self, options: option)
// 弹出
hePresentPhotoPickerController(picker: picker, animated: true)
自定义配置对象HEPickerOptions支持的属性
/// 要挑选的数据类型
public var mediaType : HEMediaType = .imageAndVideo
/// 列表是否按创建时间升序排列
public var ascendingOfCreationDateSort : Bool = false
/// 挑选图片的最大个数
public var maxCountOfImage = 9
/// 挑选视频的最大个数
public var maxCountOfVideo = 2
/// 是否支持图片单选,默认是false,如果是ture只允许选择一张图片(如果 mediaType = imageAndVideo 或者 imageOrVideo 此属性无效)
public var singlePicture = false
/// 是否支持视频单选 默认是false,如果是ture只允许选择一个视频(如果 mediaType = imageAndVideo 此属性无效)
public var singleVideo = false
/// 实现多次累加选择时,需要传入的选中的模型。为空时表示不需要多次累加
public var defaultSelections : [HEPhotoAsset]?
许可证
HEPhotoPicker 使用 MIT 许可证,详情见 LICENSE 文件。
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].