                 return
             }
             
-            let threashold = (self.myDataSource == nil) ? CGFloat(0.5) : self.myDataSource!.threasholdOfZoom(self)
-            if (self.collectionViewLayout as? UICollectionViewTransitionLayout)?.transitionProgress > threashold {
+            let threshold = (self.myDataSource == nil) ? defaultThresholdOfZoom : self.myDataSource!.thresholdOfZoom(self)
+            if (self.collectionViewLayout as? UICollectionViewTransitionLayout)?.transitionProgress > threshold {
                 self.finishInteractiveTransition()
                 self.numberOfCells = self.nextNumberOfCells()
             } else {

    
    private func collectionViewFlowLayout(numberOfCells: Int) -> UICollectionViewFlowLayout {
        let layout = UICollectionViewFlowLayout()
        let margin = (self.myDataSource == nil) ? CGFloat(2) : self.myDataSource!.marginOfCells(self)
        let cellWidth = (UIScreen.mainScreen().bounds.size.width - margin * (CGFloat(numberOfCells) + 1)) / CGFloat(numberOfCells)
        layout.itemSize = CGSize(width: cellWidth , height: cellWidth)
        return layout


import UIKit

private struct DefaultNumberOfCells {
    static let min = 1
    static let max = 5
}
private let defaultMarginOfCells = CGFloat(2)
private let defaultThresholdOfZoom = CGFloat(0.5)

// MARK: ResizableCollectionViewDelegate
public protocol ResizableCollectionViewDelegate : UICollectionViewDelegate {
    
    func willPinchIn(collectionView: ResizableCollectionView)
