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

    private func nextNumberOfCells() -> Int {
        switch (self.zoomingStatus) {
        case .zoomIn:
            return self.numberOfCells - 1
        case .zoomOut:
            return self.numberOfCells + 1
        default:
            return self.numberOfCells
        }
    }
    

// MARK: - ResizableCollectionView
public class ResizableCollectionView: UICollectionView {
    
    private var _numberOfCells = DefaultNumberOfCells.min
    public var numberOfCells: Int {
        get {
            return self._numberOfCells
        }
        set {
            let min = (self.myDataSource == nil) ? DefaultNumberOfCells.min : self.myDataSource!.minNumberOfCellsInLine(self)
            let max = (self.myDataSource == nil) ? DefaultNumberOfCells.max : self.myDataSource!.maxNumberOfCellsInLine(self)
            let value = (newValue < min) ? min : newValue
            self._numberOfCells = (value > max) ? max : value
            self.collectionViewLayout = self.collectionViewFlowLayout(self._numberOfCells)
            self.reloadData()
        }
    }
    
    /// ResizableCollectionViewDelegate
    override weak public var delegate: UICollectionViewDelegate? {
