zepojo / UPCarouselFlowLayout

A fancy carousel flow layout for UICollectionView on iOS.
MIT License
1.67k stars 235 forks source link

UPCarouselFlowLayout

UPCarouselFlowLayout is a fancy carousel flow layout for UICollectionView. It comes with a paginated effect and it shrinks and makes transparent the side items.

demo

Requirements

Installation

CocoaPods

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

pod "UPCarouselFlowLayout"

Carthage

Users can simply add to their Cartfile:

github "ink-spot/UPCarouselFlowLayout"

Manual

Simply copy the folder UPCarouselFlowLayout to your project and import it in XCode.

Usage

Getting Started

Via code
import UPCarouselFlowLayout

Create a UPCarouselFlowLayout object, set its itemSize and assign it to your UICollectionView.

let layout = UPCarouselFlowLayout()
layout.itemSize = CGSizeMake(200, 200)
collectionView.collectionViewLayout = layout
Via Interface Builder

Set the UICollectionView layout class to UPCarouselFlowLayout, and set its itemSize and its properties.

demo

Properties

UPCarouselFlowLayout has a few customizable properties:

License

UPCarouselFlowLayout is released under the MIT license. See LICENSE for details.