• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mikaoj/BSImagePicker: A multiple image picker for iOS

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

mikaoj/BSImagePicker

开源软件地址:

https://github.com/mikaoj/BSImagePicker

开源编程语言:

Swift 99.1%

开源软件介绍:

BSImagePicker

CI Status Version License Platform Carthage compatible

alt text

A multiple image picker for iOS.

Features

  • Multiple selection.
  • Fullscreen preview
  • Switching albums.
  • Supports images, live photos and videos.
  • Customizable.

Usage

Info.plist

To be able to request permission to the users photo library you need to add this to your Info.plist

<key>NSPhotoLibraryUsageDescription</key>
<string>Why you want to access photo library</string>
Image picker
import BSImagePicker

let imagePicker = ImagePickerController()

presentImagePicker(imagePicker, select: { (asset) in
    // User selected an asset. Do something with it. Perhaps begin processing/upload?
}, deselect: { (asset) in
    // User deselected an asset. Cancel whatever you did when asset was selected.
}, cancel: { (assets) in
    // User canceled selection. 
}, finish: { (assets) in
    // User finished selection assets.
})
PHAsset

So you have a bunch of PHAssets now, great. But how do you use them? To get an UIImage from the asset you use a PHImageManager.

import Photos

// Request the maximum size. If you only need a smaller size make sure to request that instead.
PHImageManager.default().requestImage(for: asset, targetSize: PHImageManagerMaximumSize, contentMode: .aspectFit, options: nil) { (image, info) in
    // Do something with image
}

For more example you can clone this repo and look at the example app.

Installation

Cocoapods

Add the following line to your Podfile:

pod "BSImagePicker", "~> 3.1"

Carthage

Add the following line to your Cartfile:

github "mikaoj/BSImagePicker" ~> 3.1

Swift Package Manager

Add it to the dependencies value of your Package.swift.:

dependencies: [
.package(url: "https://github.com/mikaoj/BSImagePicker.git", from: "version-tag")
]

Xamarin

If you are Xamarin developer you can use Net.Xamarin.iOS.BSImagePicker

Contribution

Users are encouraged to become active participants in its continued development — by fixing any bugs that they encounter, or by improving the documentation wherever it’s found to be lacking.

If you wish to make a change, open a Pull Request — even if it just contains a draft of the changes you’re planning, or a test that reproduces an issue — and we can discuss it further from there.

License

BSImagePicker is available under the MIT license. See the LICENSE file for more info.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Sponsor @mikaoj on GitHub Sponsors · GitHub发布时间:2022-06-21
下一篇:
hanxu317317/city_pickers: flutter ios city_pickers发布时间:2022-06-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap