Git Product home page Git Product logo

upcarouselflowlayout's Introduction

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

  • iOS 8.1+

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:

  • sideItemScale (between 0 and 1, default is 0.6) Can be set through code or via Interface Builder. The shrinking ratio for collection items which are not in the center.

  • sideItemAlpha (between 0 and 1, default is 0.6) Can be set through code or via Interface Builder. The opacity ratio for collection items which are not in the center.

  • sideItemShift (value in pixels, default is 0) Can be set through code or via Interface Builder. A vertical/horizontal offset (depending on the collectionView scroll direction) for collection items which are not in the center.

  • spacingMode (default is fixed spacing of 40 pts) Can be set only through code.

    • UPCarouselFlowLayoutSpacingMode.fixed(spacing: CGFloat) Items in the carousel are positioned with a fixed space between them.
    • UPCarouselFlowLayoutSpacingMode.overlap(visibleOffset: CGFloat) A fixed part of the side items are visible on the sides of the collection (and therefore the space between items depends on the collection size).

License

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

upcarouselflowlayout's People

Contributors

0ber avatar andre991 avatar sirarkimedes avatar zepojo 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.