Skip to content

Latest commit

 

History

History
93 lines (74 loc) · 3.8 KB

File metadata and controls

93 lines (74 loc) · 3.8 KB

CollectionViewWheelLayoutSwift

CI Status Version Carthage compatible [License] (http://cocoapods.org/pods/CollectionViewWheelLayoutSwift) 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

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

Installation with CocoaPods

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

pod "CollectionViewWheelLayoutSwift"

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/CollectionViewWheelLayoutSwift"

Install manually

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

USAGE

Just config your CollectionView with this layout:

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

Support 8 types layout:

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

Customize your layout:

public struct WheelLayoutConfiguration {
    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, zmw@izmw.me

License

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