Latest 0.0.3
Homepage https://github.com/William-Weng/WWCircularCollectionView
License MIT
Platforms ios 10.0
Frameworks UIKit
Authors

一個可以無限滾動的滾輪

Swift 4.0 Version Platform License

WWCircularCollectionView

使用範例

IBOutlet

import UIKit
import WWCircularCollectionView

class ViewController: UIViewController {

    @IBOutlet weak var nowLabel: UILabel!
    @IBOutlet weak var lastLabel: UILabel!
    @IBOutlet weak var collectionView: WWCircularCollectionView!

    let isInfinity = true

    override func viewDidLoad() {
        super.viewDidLoad()
        delegateSetting()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
}

extension ViewController {

    func delegateSetting() {

        guard let layout = collectionView.collectionViewLayout as? WWCircularCollectionViewLayout else { return }

        layout.wwDelegate = self
        collectionView.wwDelegate = self
    }
}

extension ViewController: WWCircularCollectionViewDelegate {

    func isInfinity(_ wwCircularCollectionView: WWCircularCollectionView) -> Bool {
        return isInfinity
    }

    func imagesDiectory(_ wwCircularCollectionView: WWCircularCollectionView) -> [String] {
        return Bundle.main.paths(forResourcesOfType: "png", inDirectory: "Images")
    }
}

extension ViewController: WWCircularCollectionViewLayoutDelegate {

    func wwCircularCollectionViewLayout(_ wwCircularCollectionViewLayout: WWCircularCollectionViewLayout, selectedIndex index: Int) {
        nowLabel.text = index.description
    }

    func wwCircularCollectionViewLayout(_ wwCircularCollectionViewLayout: WWCircularCollectionViewLayout, lastSelectedIndex index: Int) {
        lastLabel.text = index.description
    }
}

Latest podspec

{
    "name": "WWCircularCollectionView",
    "version": "0.0.3",
    "summary": "WWCircularCollectionView is a infinite wheel. (u4e00u500bu53efu4ee5u7121u9650u6efeu52d5u7684u6efeu8f2a)",
    "homepage": "https://github.com/William-Weng/WWCircularCollectionView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "u7fc1u79b9u658c(William.Weng)": "[email protected]"
    },
    "platforms": {
        "ios": "10.0"
    },
    "ios": {
        "vendored_frameworks": "WWCircularCollectionView.framework"
    },
    "source": {
        "git": "https://github.com/William-Weng/WWCircularCollectionView.git",
        "tag": "0.0.3"
    },
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This