Code Monkey home page Code Monkey logo

assetpicker's Introduction

AssetPicker - iOS (Objective-C)

AssetPicker is a UIViewController subclass that provides an alternative solution to standard UIImagePickerController. Highlights are :-

  • Have both modes within single screen (Use Library or Use Camera).
  • Select Multiple Assets (Photos / Videos).
  • Browse all the albums within one screen.
  • Filters :- Photos(Default), Videos, All
  • Supports Portrait & Landscape Modes. (Autorotation supported (UIInterfaceOrientationMaskAllButUpsideDown))
  • Uses Blocks for completion & cancel (Maintains integrity of code)
  • Provides original ALAsset in returned response. (Better use it's properties)
  • Provides ContentsURL for both Photos & Videos. (No UIImage directly, memory issues with multiple selection)
  • Considers standard TabBarHeight and leaves space for that if set YES.
  • Set Maximum Limits Independently on Photos, Videos, Assets.

Requirements

  • iOS 6.0 or later, ARC is must.
  • QuartzCore.Framework
  • AssetsLibrary.Framework

Installation

  • Like CocoaPods, just add this to your podfile-
pod 'AssetPicker'
  • Want the source directly, just copy the AssetPicker folder (Art & Source).

How To Use

Configuring AssetPicker is just like this :

[AssetPicker showAssetPickerIn:self.navigationController
              maximumAllowedPhotos:4
              maximumAllowedVideos:4
                 completionHandler:^(AssetPicker* picker, NSArray* assets)
     {
         NSLog(@"Assets --> %@", assets);
         
         // Do your stuff here
         
         // All done with the resources, let's reclaim disk memory
         [AssetPicker clearLocalCopiesForAssets];
     }
                     cancelHandler:^(AssetPicker* picker)
     {
         NSLog(@"Cancelled.");
     }];

and your work is done. AssetPicker does it all for you.

  • It uses AssetsLibrary to fetch Albums Info, populates it into a nice UI.
  • Provides all the albums browsing within one screen.
  • Provides Camera option for new photo / video capture.

iPad Portrait

![iPad_Portrait] (https://raw.githubusercontent.com/taruntyagi697/AssetPicker/master/Screenshots/iPad_Portrait.png)

iPad Landscape

![iPad_Landscape] (https://raw.githubusercontent.com/taruntyagi697/AssetPicker/master/Screenshots/iPad_Landscape.png)

iPhone Portrait

![iPhone_Portrait] (https://raw.githubusercontent.com/taruntyagi697/AssetPicker/master/Screenshots/iPhone_Portrait.png)

iPhone Landscape

![iPhone_Landscape] (https://raw.githubusercontent.com/taruntyagi697/AssetPicker/master/Screenshots/iPhone_Landscape.png)

Demo App

Demo app includes just the above 'How To Use' code for reference.

assetpicker's People

Contributors

taruntyagi697 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.