Latest 1.0.1
Homepage https://github.com/gewill/GWCollectionViewFloatCellLayout
License MIT
Platforms ios 8.0
Authors

Summary

Custom layout for a collection view using vertical scrolling with float cell, like UICollectionViewFlowLayout. Written in Swift.

Screenshot

screencast

Requirements

Swift 3.0, iOS 8.0

Use

Just set layout properties when viewDidLoad

import GWCollectionViewFloatCellLayout
    override func viewDidLoad() {
        super.viewDidLoad()

        let sectionWidth = UIScreen.main.bounds.width
        self.layout.floatItemSize = CGSize(width: sectionWidth, height: 20)
        self.layout.itemSize = CGSize(width: sectionWidth / 6, height: 40)
        self.layout.headerReferenceSize = CGSize(width: sectionWidth, height: 50)
        self.layout.footerReferenceSize = CGSize(width: sectionWidth, height: 50)

        self.layout.sectionInset = UIEdgeInsets(top: 10, left: 20, bottom: 30, right: 40)
        self.layout.minimumLineSpacing = 2
        self.layout.minimumInteritemSpacing = 4
    }

Installation

Feel free to drag GWCollectionViewFloatCellLayout.swift to your iOS Project. But it’s recommended to use Carthage (or CocoaPods).

Carthage

github "gewill/GWCollectionViewFloatCellLayout" >= 1.0.0

CocoaPods

pod 'GWCollectionViewFloatCellLayout', '~> 1.0.0'

Thanks

Thanks to  Brightec blog & Demo

Contact

Follow and contact me on Twitter or Sina Weibo. If you find an issue, just open a ticket on it. Pull requests are warmly welcome as well.

License

GWCollectionViewFloatCellLayout is available under the MIT License

Latest podspec

{
    "name": "GWCollectionViewFloatCellLayout",
    "version": "1.0.1",
    "summary": "Custom layout for a collection view using vertical scrolling with float cell, like UICollectionViewFlowLayout.",
    "description": "Custom layout for a collection view using vertical scrolling with float cell, like UICollectionViewFlowLayout. Written in Swift.",
    "homepage": "https://github.com/gewill/GWCollectionViewFloatCellLayout",
    "screenshots": "https://github.com/gewill/GWCollectionViewFloatCellLayout/raw/master/screencast.gif",
    "license": "MIT",
    "authors": {
        "Ge Will": "[email protected]"
    },
    "social_media_url": "https://twitter.com/gewill_org",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/gewill/GWCollectionViewFloatCellLayout.git",
        "tag": "1.0.1"
    },
    "source_files": [
        "GWCollectionViewFloatCellLayout",
        "GWCollectionViewFloatCellLayout/**/*.{h,m,swift}"
    ],
    "exclude_files": "Classes/Exclude",
    "public_header_files": "GWCollectionViewFloatCellLayout/GWCollectionViewFloatCellLayout.h",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3.0"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This