A replacement for UIImagePickerController
with multiple selection support written in Swift.
Features | |
---|---|
Replace UIImagePickerController adding support to multiple selection |
|
👨🏻💻 | Written in Swift with full Objective-C compatibility |
iCloud Photo Library support | |
Customize the UI for your app | |
Open to string localization |
We use the open source version master
branch in the Subito app.
Requirements
- Xcode 10.0+
- iOS 9.0+
- Swift 4.2+
- Interoperability with Objective-C
Installation
Pellicola is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Pellicola'
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Getting started
Create a PellicolaPresenter
object with a style. We provide a DefaultPellicolaStyle
object which uses a default style for Pellicola. The didSelectImages
closure provides an array of selected images ordered by the user selection. The userDidCancel
closure let you know if the user exits from the flow.
Use the method present(on: UIViewController, maxNumberOfSelections: Int)
to show Pellicolsa and specify the maximum number of selectable images.
and userDidCancel
closures to get
import UIKit
import Pellicola
class ViewController: UIViewController {
var pellicolaPresenter: PellicolaPresenter!
override func viewDidLoad() {
super.viewDidLoad()
pellicolaPresenter = PellicolaPresenter(style: DefaultPellicolaStyle())
pellicolaPresenter.didSelectImages = { images in
print("User selected \(images.count) images")
}
pellicolaPresenter.userDidCancel = {
print("User did cancel the flow")
}
pellicolaPresenter.present(on: self, maxNumberOfSelections: 10)
}
}
Authors
Contributing
Feel free to collaborate with ideas, issues and/or pull requests.
P.S. If you use Pellicola in your app we would love to hear about it!
License
Pellicola is available under the Apache License, Version 2.0. See the LICENSE file for more info.