                 
                 let xOffset = Float(sectionInset.left) + Float(itemWidth + minimumColumnSpacing) * Float(columnIndex)
                 let yOffset = columnHeights[columnIndex]
-                let itemSize = delegate.collectionView(collectionView, layout: self, sizeForItemAtIndexPath: indexPath)
+                let itemSize = delegate?.collectionView(collectionView, layout: self, sizeForItemAtIndexPath: indexPath)
                 var itemHeight: Float = 0.0
-                if itemSize.height > 0 && itemSize.width > 0 {
-                    itemHeight = Float(itemSize.height) * itemWidth / Float(itemSize.width)
+                if itemSize?.height > 0 && itemSize?.width > 0 {
+                    itemHeight = Float(itemSize!.height) * itemWidth / Float(itemSize!.width)
                 }
                 
                 attributes = UICollectionViewLayoutAttributes(forCellWithIndexPath: indexPath)

            return;
        }
        
        assert(delegate.conformsToProtocol(CollectionViewWaterfallLayoutDelegate), "UICollectionView's delegate should conform to WaterfallLayoutDelegate protocol")
        assert(columnCount > 0, "WaterfallFlowLayout's columnCount should be greater than 0")
        
        // Initialize variables

            * 2. Section header
            */
            var headerHeight: Float
            if let height = delegate?.collectionView?(collectionView, layout: self, heightForHeaderInSection: section) {
                headerHeight = height
            }
            else {
