Pickle

Carousell flavoured image picker with multiple photo selections.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

60

Maintenance

Last Commit

2yrs ago

Contributors

11

Package

Dependencies

0

License

Apache License 2.0

Categories

Readme

Pickle

Build Status Carthage compatible CocoaPods Compatible Platform Swift 4.2

Carousell image picker.

  • Multiple image selections across albums
  • Picking photos in the desired order
  • Customizable theme

Usage

import Pickle

The usage is similiar to UIImagePickerController:

let picker = ImagePickerController()
picker.delegate = self as? ImagePickerControllerDelegate
present(picker, animated: true, completion: nil)

Display preselected images:

let assets: [PHAsset] = []
let picker = ImagePickerController(selectedAssets: assets)

Update selectedAssets with new values and update the UI. It won't trigger any delegate callbacks.

func updateSelectedAssets(with assets: [PHAsset])

ImagePickerController will request permission to access Photos if needed when it's presented.

Delegate

ImagePickerControllerDelegate is responsible for dismissing the image picker. Required delegate methods:

/// Asks the delegate if the image picker should launch camera with certain permission status.
func imagePickerController(_ picker: ImagePickerController, shouldLaunchCameraWithAuthorization status: AVAuthorizationStatus) -> Bool

/// Tells the delegate that the user picked image assets. The delegate is responsible for dismissing the image picker.
func imagePickerController(_ picker: ImagePickerController, didFinishPickingImageAssets assets: [PHAsset])

/// Tells the delegate that the user cancelled the pick operation. The delegate is responsible for dismissing the image picker.
func imagePickerControllerDidCancel(_ picker: ImagePickerController)

Appearance

Customize the appearance with a modified Parameters struct, or any type that conforms to ImagePickerConfigurable.

var parameters = Pickle.Parameters()
parameters.allowedSelections = .limit(to: 4)
let picker = ImagePickerController(configuration: parameters)

See ImagePickerConfigurable.swift for a full list of configurable properties.

Camera

UIImagePickerController with sourceType = .camera is used as the default camera on devices. Launch a customized camera from the image gallery by providing a CameraCompatible type or a closure that returns a configured camera controller instance.

let picker = ImagePickerController(
  selectedAssets: [],
  configuration: Pickle.Parameters(),
  cameraType: UIImagePickerController.self
)
let initializer = {
  return UIImagePickerController()
}

let picker = ImagePickerController(
  selectedAssets: [],
  configuration: Pickle.Parameters(),
  camera: initializer
)

Documentation

Pickle Reference

https://carousell.github.io/pickle

Example Setups

Install CocoaPods:

gem install cocoapods

Set up the development pods:

make bootstrap

Requirements

PickleiOSXcodeSwift
>= 1.0.08.0+8.3.3Swift 3.1
>= 1.2.09.0+8.3.3Swift 3.1
>= 1.3.09.0+9.2Swift 4.0

Installation

Use CocoaPods

Create a Podfile with the following specification and run pod install.

platform :ios, '9.0'
use_frameworks!

pod 'Pickle'

Use Carthage

Create a Cartfile with the following specification and run carthage bootstrap. Follow the instructions to add the framework to your project.

github "carousell/pickle"

Contributing

Thank you for being interested in contributing to this project. Check out the CONTRIBUTING document for more info.

About

Carousell

Pickle is created and maintained by Carousell. Help us improve this project! We'd love the feedback from you.

We're hiring! Find out more at http://careers.carousell.com/

License

Pickle is released under Apache License 2.0. See LICENSE for more details.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial