Latest 1.0.0
Homepage https://github.com/yuhua-chen/MCCardPickerCollectionViewController
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation, UIKit
Authors

cocoapod-badge

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

Latest podspec

{
    "name": "MCCardPickerCollectionViewController",
    "version": "1.0.0",
    "summary": "A card collection view controller inspired by Facebook People you may know.",
    "description": "                   A card collection view controller inspired by Facebook People you may know.nn                   - Required on iOS 7.n                   - Use it as normal collection view controller.n",
    "homepage": "https://github.com/yuhua-chen/MCCardPickerCollectionViewController",
    "screenshots": "https://s3.amazonaws.com/cocoacontrols_production/uploads/control_image/image/5856/iOS_Simulator_Screen_Shot_2015_3_4____5.11.02.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Michael Chen": "[email protected]"
    },
    "social_media_url": "http://twitter.com/yuhua_twit",
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/yuhua-chen/MCCardPickerCollectionViewController.git",
        "tag": "1.0.0"
    },
    "source_files": "MCCardPickerCollectionViewController/Classes",
    "exclude_files": "Classes/Exclude",
    "requires_arc": true,
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This