Coder Social home page Coder Social logo

ronadolong / ctassetspickercontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 1and2papa/ctassetspickercontroller

1.0 2.0 0.0 6.51 MB

iOS control that allows picking multiple photos and videos from user's photo library.

License: MIT License

Ruby 0.50% Objective-C 99.41% Shell 0.08%

ctassetspickercontroller's Introduction

CTAssetsPickerController

Development Suspended (1 June, 2016)

As I am busy on both of my work and personal life, it seems that I have no more spare time to maintain this project in coming year. The development of this project is suspended. Anyone who would like to keep this project running, just fork it.

Introduction

CTAssetsPickerController is a highly customisable iOS controller that allows picking multiple photos and videos from user's photo library. The usage and look-and-feel are just similar to UIImagePickerController. It uses ARC and requires Photos framework.

Screenshot Screenshot 2

Features

  1. Picks multiple photos and videos across albums from user's library.
  2. Previews assets by long-press gesture.
  3. Filters assets for picking only photos or videos.
  4. Filters assets or albums by their properties.
  5. Supports assets stored in iCloud.
  6. Supports many languages.
  7. Optionally shows selection order.
  8. Achieves average 5x fps.
  9. Conforms UIAppearance protocol.
  10. Conforms UIAccessibility protocol.
  11. Highly customisable.
  12. Pure Auto Layout. (Thanks for the great work of PureLayout)

Release Notes

Minimum Requirement

iOS 9 SDK, Minimum Deployment Target iOS 8.0

Adding to your project

  1. CocoaPods Podfile

    platform :ios, '8.0'
    pod 'CTAssetsPickerController',  '~> 3.3.0'
    
  2. Manual Setup

Usages

  1. Import header

    #import <CTAssetsPickerController/CTAssetsPickerController.h>
  2. Create and present CTAssetsPickerController

    // request authorization status
    [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status){
        dispatch_async(dispatch_get_main_queue(), ^{
            
            // init picker
            CTAssetsPickerController *picker = [[CTAssetsPickerController alloc] init];
        
            // set delegate
            picker.delegate = self;
            
            // Optionally present picker as a form sheet on iPad
            if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
                picker.modalPresentationStyle = UIModalPresentationFormSheet;
            
            // present picker
            [self presentViewController:picker animated:YES completion:nil];
        });
    }];
  3. Implement didFinishPickingAssets delegate

    If the picker is presented by presentViewController:animated:completion: method, the delegate is responsible for dismissing the picker when the operation completes.

    - (void)assetsPickerController:(CTAssetsPickerController *)picker didFinishPickingAssets:(NSArray *)assets
    {
    // assets contains PHAsset objects.
    }

Questions, Issues and Suggestions

Please check with wiki and issues for common issues and questions. Please open a [new Issue] (https://github.com/chiunam/CTAssetsPickerController/issues/new) if you run into a problem specific to the picker. Bug reports and pull requests are always welcome.

Bonus

You may reuse the preview feature of the picker to view any assets. Just init a CTAssetsPageViewController with an array of assets and assign pageIndex property. Please refer to the demo app for the details.

NSArray *assets = @[asset1, asset2, asset3, ...];
CTAssetsPageViewController *vc = [[CTAssetsPageViewController alloc] initWithAssets:assets];
vc.pageIndex = assets.count - 1; // display the last asset 

[self.navigationController pushViewController:vc animated:YES];

Documentation

License

The MIT License (MIT)

Copyright (c) 2015 Clement CN Tsang

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

ctassetspickercontroller's People

Contributors

1and2papa avatar akcbryant avatar bawn avatar bluevirusx avatar chrisze avatar fatalaa avatar giladno avatar jneiluj avatar kevinwo avatar krusek avatar m1entus avatar rabiakoca avatar remylivewall avatar sadiq81 avatar sega-zero avatar

Stargazers

 avatar

Watchers

 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.