 
 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)

    func pinch(gesture: UIPinchGestureRecognizer) {
        switch (gesture.state) {
        case .Began:
            let min = (self.myDataSource == nil) ? 1 : self.myDataSource!.minNumberOfCellsInLine(self)
            let max = (self.myDataSource == nil) ? 5 : self.myDataSource!.maxNumberOfCellsInLine(self)
            
            if gesture.scale > 1.0 && self.numberOfCells > min {
                self.zoomingStatus = .zoomIn

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