Coder Social home page Coder Social logo

mccardpickercollectionviewcontroller's Introduction

cocoapod-badge

MCCardPickerCollectionViewController

A card collection view controller inspired by Facebook People you may know.

Take a while for screenshot :p
screen-shot

Compatibility

Required on iOS 7.

Usage

Simply drag and drop the classes under /Classes folder and use it like normal collection view controller.

To initialize the MCCardPickerCollectionViewController

MCCardPickerCollectionViewController *cardViewController = [[MCCardPickerCollectionViewController alloc] init];
	cardViewController.delegate = self;
	//Don't forget to register cell like usual collection view.
	[cardViewController.collectionView registerClass:[MCSampleCardCollectionViewCell class] forCellWithReuseIdentifier:kCellIdentifier];

and implement the delegate:

- (void)cardPickerCollectionViewController:(MCCardPickerCollectionViewController *)cardPickerCollectionViewController preparePresentingView:(UIView *)presentingView fromSelectedCell:(UICollectionViewCell *)cell
{
    //Do whatever you want to prepare for the presenting view.
}

// and collection view delegate and data source

To present view controler, we use our own method to present instead of presentViewController:animated:completion: in order to keep the transparent background.

- (void)presentInViewController:(UIViewController *)viewController;

To dismiss view controller, likewise we use our own method:

- (void)dismissFromParentViewController;

Moreover there are some properties of MCCardPickerCollectionViewFlowLayout you can adjust. If you want to change the padding of cards, you can just set minimumLineSpacing:

cardViewController.layout.minimumLineSpacing = 40;

and the bouncing velocity of centering card by setting flickVelocity:

cardViewController.layout.flickVelocity = 0.5;

The current index means the card number user picked:

NSInteger currentIndex = cardViewController.layout.currentIndex;

License

This project is under MIT License. Please feel free to use.
Michael Chen @yuhua_twit

mccardpickercollectionviewcontroller's People

Contributors

yuhua-chen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mccardpickercollectionviewcontroller's Issues

create an instance of the scrollview

I really like this implementation, but there is a small issue in the Demo that causes memory issue related to creating instance every-time you expand the presentingview full screen.

screen shot 2015-05-01 at 4 07 47 pm

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.