Latest 0.6.1
Homepage https://github.com/pitiphong-p/CenterAlignedCollectionViewFlowLayout
License MIT
Platforms ios 8.0
Authors

A UICollectionViewFlowLayout subclass that centers its cell to center.

Requirements

  • iOS 8+
  • Swift 3.0+

This requirement is due to the Swift runtime is available on iOS 8 or later. If you want to use this CenterAlignedCollectionViewFlowLayout.

Installation

Manaully

This project comes with built in CenterAlignedCollectionViewFlowLayout framework target. You can drag CenterAlignedCollectionViewFlowLayout.xcproj file into your project, add CenterAlignedCollectionViewFlowLayout framework target as a target dependency and link/embed that framework. and Voila!!!

import CenterAlignedCollectionViewFlowLayout

Or you can just add CenterAlignedCollectionViewFlowLayout.swift into your project.

CocoaPod

Add the following to your Podfile

pod 'CenterAlignedCollectionViewFlowLayout'
use_frameworks!

Swift 2

You can use CenterAlignedCollectionViewFlowLayout in Swift 2.2 by checking out tag 0.5.0

Usage

You can set the collecion view’s layout to an instance of CenterAlignedCollectionViewFlowLayout, that’s all. You can set its layout both via code or Storyboard.

collectionView.collectionViewLayout = CenterAlignedCollectionViewFlowLayout()

Demo App

CenterAlignedCollectionViewFlowLayout project comes with a demo app target. You can see CenterAlignedCollectionViewFlowLayout in action by just running this demo app target.

Contact

Pitiphong Phongpattranont

License

CenterAlignedCollectionViewFlowLayout is released under an MIT License.
Copyright © 2015-present Pitiphong Phongpattranont.

Latest podspec

{
    "name": "CenterAlignedCollectionViewFlowLayout",
    "version": "0.6.1",
    "summary": "A UICollectionViewFlowLayout subclass that will center its cells.",
    "homepage": "https://github.com/pitiphong-p/CenterAlignedCollectionViewFlowLayout",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Pitiphong Phongpattranont": "[email protected]"
    },
    "social_media_url": "http://twitter.com/pitiphong_p",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/pitiphong-p/CenterAlignedCollectionViewFlowLayout.git",
        "tag": "0.6.1"
    },
    "source_files": "CenterAlignedCollectionViewFlowLayout.swift"
}

Pin It on Pinterest

Share This