Latest 1.1.0
Homepage https://github.com/carousell/pickle
License Apache License 2.0
Platforms ios 8.0
Authors ,

Build Status
Carthage compatible
CocoaPods Compatible
Platform
CocoaDocs
Swift 3.1

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)

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)

Customization

Appearance

Customize the appearance with a type that conforms to ImagePickerConfigurable.

let configuration: ImagePickerConfigurable = CustomizedType()
let picker = ImagePickerController(configuration: configuration)

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: CustomizedType(),
  cameraType: UIImagePickerController.self
)
let initializer = {
  return UIImagePickerController()
}

let picker = ImagePickerController(
  selectedAssets: [],
  configuration: CustomizedType(),
  camera: initializer
)

Requirements

Pickle iOS Xcode Swift
~> 1.0.0 8.0+ 8.3.3 Swift 3.1

Installation

Use CocoaPods

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

platform :ios, '8.0'
use_frameworks!

pod 'Pickle', '~> 1.0.0'

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" ~> 1.0.0

Example

Install CocoaPods:

gem install cocoapods

Set up the development pods:

pod install --project-directory=Example && open Example/Pickle.xcworkspace

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.

Latest podspec

{
    "name": "Pickle",
    "version": "1.1.0",
    "summary": "Carousell flavoured image picker with multiple photo selections.",
    "homepage": "https://github.com/carousell/pickle",
    "license": {
        "type": "Apache License 2.0",
        "file": "LICENSE"
    },
    "authors": {
        "bcylin": "bcylin@gmail.com",
        "Suganth": "suganth@live.in"
    },
    "source": {
        "git": "https://github.com/carousell/pickle.git",
        "tag": "1.1.0"
    },
    "social_media_url": "https://twitter.com/thecarousell",
    "platforms": {
        "ios": "8.0"
    },
    "ios": {
        "frameworks": "Photos"
    },
    "source_files": "Pickle/Classes/**/*",
    "resources": "Pickle/Assets/**/*",
    "pushed_with_swift_version": "3.1"
}

Pin It on Pinterest

Share This