Latest 0.1.1
License MIT
Platforms ios 8.0
Frameworks UIKit


Based on Brightec’s solution this pod will allow you to have an UIColletionView working like an Excel (PC) or Numbers’ (OS X) sheet. Plus, and not less important, you will have the total control about your UICollectionView’s design and how it should look like!

This is the expected behavior in the implemented UICollectionView:

UICollectionView's expected behavior


  • iOS 8.0+
  • Xcode 8.0+
  • Swift 4.0



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

pod 'ExcelCollectionViewLayout'


Just drag and drop ExcelCollectionViewLayout.swift inside your project.


Set ExcelCollectionViewLayout as your UICollectionView’s layout:

  • Go to your UICollectionView’s inspector
  • Select Custom in the Layout selector
  • Type ExcelCollectionViewLayout in the Class selector (it should autocomplete and/or appear in the dropdown list).

UICollectionView's inspector

Set ExcelCollectionViewLayout’s delegate, responsible for calculating each column’s items’ size:

override func viewDidLoad() {

    if let collectionLayout = collectionView.collectionViewLayout as? ExcelCollectionViewLayout {
        collectionLayout.delegate = self

After setting ExcelCollectionViewLayoutDelegate, you must implement the delegate’s method which will allow you to calculate column’s items’ size or just set it arbitrarily:

func collectionViewLayout(_ collectionViewLayout: ExcelCollectionViewLayout, sizeForItemAtColumn columnIndex: Int) -> CGSize {
    return CGSize(width: 100, height: 50)

PS.: This pod’s example has a good example of calculated items’ size.

And we are all set up! As said before, you still have the total control about your UICollectionView’s design and how it should be like, all it takes care of is the UICollectionView’s cells arrangement!

Keep in mind: when setting UICollectionViewDataSource’s methods the sections are the rows and rows are the columns.

Section-row relationship.


To run the example project simply type pod try ExcelCollectionViewLayout on Terminal. Or clone the repo, and run pod install from the Example directory first.


Created, updated and maintained by Rafael Rocha.


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

Latest podspec

    "name": "ExcelCollectionViewLayout",
    "version": "0.1.1",
    "summary": "An Excel-like UICollectionView's layout.",
    "description": "This will allow you to work with UICollectionViews like Excel and Number's sheets.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": "Rafael Rocha",
    "source": {
        "git": "",
        "tag": "0.1.1"
    "platforms": {
        "ios": "8.0"
    "source_files": "ExcelCollectionViewLayout/Classes/**/*",
    "frameworks": "UIKit"

Pin It on Pinterest

Share This