Latest 0.3.0
Homepage https://github.com/ValentinDenis/CWCollectionView
License MIT
Platforms ios 9.0
Authors

Description

UICollectionView subclass to easily setup a collection view with a given number of columns.
Just so you know, it uses swizzling for these two methods of UICollectionViewDelegate:

collectionView(_:layout:sizeForItemAt:)
collectionView(_:layout:insetForSectionAt:)

How to use

Just use CWCollectionView as a class for your collection view (from storyboard or code)
Make your VC implement CWCollectionViewDelegate
These methods need to be implemented:

func numberOfCulumns() -> Int
func itemHeightRatio() -> CGFloat
func sectionInsets() -> UIEdgeInsets
func itemMinimumMargin() -> CGFloat
func headerHeight() -> CGSize

Then don’t forget to set the cwDelegate property of your collectionView.

cwCollectionView.cwDelegate = self

Clone the repo to see an exemple project

Example

To run the example project, clone the repo, and run the xcodeproj

Requirements

CWCollectionView is compatible for iOS versions > 9.0
CWCollectionView is written in swift 4.1

Installation

Just add the the following line for your target:

pod 'CWCollectionView'

Then run

pod install

Author

![Cwep](http://static.750g.com/images/622-auto/d5ad3d69b82fb7b65b81313a45c80973/crepes-de-grand-mere.png =200x)
Cwep, [email protected]

License

MIT

Latest podspec

{
    "name": "CWCollectionView",
    "version": "0.3.0",
    "summary": "Easily create collection views with a desired number of columns",
    "description": "UICollectionView subclass to easily setup a collection view with a given number of columns",
    "homepage": "https://github.com/ValentinDenis/CWCollectionView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Valentin Denis": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ValentinDenis/CWCollectionView.git",
        "tag": "0.3.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "CWCollectionView/CWCollectionView/CWCollectionView.swift",
    "swift_version": "4.1"
}

Pin It on Pinterest

Share This