GithubHelp home page GithubHelp logo

v-deriglazov / bsimagepicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikaoj/bsimagepicker

0.0 2.0 0.0 78.43 MB

A multiple image picker for iOS 8

License: MIT License

Ruby 1.30% Swift 68.92% Objective-C 14.25% Shell 15.53%

bsimagepicker's Introduction

BSImagePicker

CI Status Version License Platform

alt text

A mix between the native iOS 8 gallery and facebooks image picker.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.
To use it in you own project

Objective-C
BSImagePickerViewController *imagePicker = [BSImagePickerViewController new];

// Present image picker. Any of the blocks can be nil
[self bs_presentImagePickerController:imagePicker
                             animated:YES
                               select:^(PHAsset * __nonnull asset) {
                                 // User selected an asset.
                                 // Do something with it, start upload perhaps?
                               } deselect:^(PHAsset * __nonnull asset) {
                                 // User deselected an assets.
                                 // Do something, cancel upload?
                               } cancel:^(NSArray * __nonnull assets) {
                                 // User cancelled. And this where the assets currently selected.
                               } finish:^(NSArray * __nonnull assets) {
                                 // User finished with these assets
                               } completion:nil];
Swift
let vc = BSImagePickerViewController()

bs_presentImagePickerController(vc, animated: true,
    select: { (asset: PHAsset) -> Void in
      // User selected an asset.
      // Do something with it, start upload perhaps?
    }, deselect: { (asset: PHAsset) -> Void in
      // User deselected an assets.
      // Do something, cancel upload?
    }, cancel: { (assets: [PHAsset]) -> Void in
      // User cancelled. And this where the assets currently selected.
    }, finish: { (assets: [PHAsset]) -> Void in
      // User finished with these assets
}, completion: nil)

Customization

You have access to the cancel, album and done button. Customize them as you would with any other UIBarButtonItem (cancel & finish) or UIButton (album).
There are also a few other settings you can tweak.They are documented in BSImagePickerSettings.
Documentation @ cocoadocs

Custom fetch results

Not happy with the fetch results (camera roll and albums) that BSImagePicker uses as default? You can initialize it with your own!

Requirements

iOS 8

Installation

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

pod "BSImagePicker", "~> 1.4.0"

Author

Joakim Gyllström, [email protected]

License

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

bsimagepicker's People

Contributors

mikaoj avatar dimitar-lazarov avatar esttorhe avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.