         let layout = collectionView.collectionViewLayout as! UICollectionViewFlowLayout
         layout.itemSize = CGSize(width: 100, height: 100)
         layout.sectionInset = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
-        layout.headerReferenceSize = CGSizeMake(collectionView.frame.size.width, 50)
         layout.minimumInteritemSpacing = 10
         layout.minimumLineSpacing = 10
+
+        collectionView.delegate = self
 
         // register cells and supplementary views
         collectionView.registerNib(UINib(nibName: "CollectionViewCell", bundle: nil), forCellWithReuseIdentifier: collectionCellId)


    }

}

import UIKit
import JSQDataSourcesKit

class CollectionViewController: UIViewController, UICollectionViewDelegateFlowLayout {

    // MARK: outlets

