Skip to content

Siwon-L/SFImagePicker

Repository files navigation

SFImagePicker

CI Status Version License Platform SwiftPM

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 SFImagePicker

let imagePicker = SFImagePicker()

presentImagePicker(imagePicker, animated: true) { (imageManager) in
  // User selected an asset. Do something with it. Perhaps begin processing/upload?
} onDeSelction: { (imageManager) in
  // User deselected an asset. Cancel whatever you did when asset was selected.
} onFinish: { (imageManagers) in
  // User finished selection images.
} onCancel: { (imageManagers) in
  // User canceled selection.
}
SFImageManager

You need to get the image through acquired imageManager.

let imageView = UIImageView()
let size = CGSize(width: 30, height: 30)
imageManager.request(size: size) { image, _ in
  imageView.imageID = imageManager.assetID
  imageView.image = image!
}
Settings

Users can set the selector to their liking.

picker.settings.selection.max = 3 // maximum number of select
picker.settings.selection.min = 2 // minimum number of select
picker.settings.ui.selectedIndicatorColor = .green // indicator color
picker.settings.ui.selectedIndicatorTextColor = .black // indicator text color
picker.settings.fetchOptions.isSynchronous = false // Synchronous & Asynchronous
picker.settings.fetchOptions.deliveryMode = .fastFormat // delivery mode

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

SFImagePicker is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SFImagePicker'

Author

saafaaari, 111dltldnjs@gmail.com

License

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

Simulator

Main Detail

About

사진 다중 선택이 가능한 ImagePicker 입니다.

Resources

License

Stars

Watchers

Forks

Packages

No packages published