Git Product home page Git Product logo

cpcollectionviewwheellayoutswift's Introduction

CPCollectionViewWheelLayoutSwift

CI Status Version Carthage compatible [License] (http://cocoapods.org/pods/CPCollectionViewWheelLayoutSwift) Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.You can view it from Appetize

Requirements

  • Swift3
  • Xcode 8.1+
  • iOS 8.0+

Installation

CPCollectionViewWheelLayoutSwift supports multiple methods for installing the library in a project.

Installation with CocoaPods

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

pod "CPCollectionViewWheelLayoutSwift"

Installation with Carthage

Carthage is supported as well.To install it, add the following line to your Cartfile, then Drag the Framework to your Project:

github "ParsifalC/CPCollectionViewWheelLayoutSwift"

Install manually

  1. Clone OR Download this repo.
  2. Drag "CPCollectionViewWheelLayoutSwift.swift" to your project.

USAGE

Just config your CollectionView with this layout:

let configuration = CPWheelLayoutConfiguration.init(withCellSize: CGSize.init(width: 100, height: 100), radius: 200, angular: 20, wheelType:wheelType)
let wheelLayout = CPCollectionViewWheelLayout.init(withConfiguration: configuration)
let colletionView = UICollectionView.init(frame: view.frame, collectionViewLayout:wheelLayout)

Support 8 types layout:

public enum CPWheelLayoutType:Int {
    case leftBottom = 0
    case rightBottom
    case leftTop
    case rightTop
    case leftCenter
    case rightCenter
    case topCenter
    case bottomCenter
}

Customize your layout:

public struct CPWheelLayoutConfiguration {
    public var cellSize:CGSize
    public var radius:Double
    public var angular:Double   
    public var fadeAway:Bool
    public var zoomInOut:Bool
    public var maxContentHeight:Double
    public var contentHeigthPadding:Double
}

See more in Example project.

Author

Parsifal, [email protected]

License

CPCollectionViewWheelLayoutSwift is available under the MIT license. See the LICENSE file for more info.

cpcollectionviewwheellayoutswift's People

Contributors

parsifalc avatar

Stargazers

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

Watchers

 avatar  avatar

cpcollectionviewwheellayoutswift's Issues

topcenter Reverse scroll

Hello ParsifalC,

When i set wheeltype = topcenter the scroll is reverse scroll , can you help me to improve the scroll(Proper scroll)

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.