       UIGraphicsEndImageContext()
       collectionView.addSubview(newRightSideSnapshotView)
       newRightSideSnapshotView.frame = CGRect(x: bounds.maxX, y: 0, width: cell.bounds.width, height: cell.bounds.height)
-    }
-    
-    collectionView.alpha = 0
+      self.newRightSideSnapshot = newRightSideSnapshotView
+    }
+    
+    collectionView.visibleCells.forEach { $0.alpha = 0 }
     
     // MARK: Animate old cell out
     let oldCellLayer = oldCellSnapshotView.layer

    bottomOverlayGradient.frame = CGRect(x: 0, y: collectionView.frame.maxY, width: bounds.width, height: bottomOverylayHeight)
  }
  
  public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    return false
  }
  
}


      $0.item < $1.item
    }
    
    var cellIndex = 0
    var oldCellFrame = CGRect.zero
    for path in paths {
      guard let cell = collectionView.cellForItem(at: path) else { continue }
      cell.alpha = 1
      let offset = collectionView.contentOffset.x
      var frame = cell.frame
      frame.origin.x -= offset
      if frame.minX > 0 {
        oldCellFrame = frame
        break
      }
      cellIndex += 1
    }
    
    
    // MARK: Snapshot of old cell
    if let path = paths[safe: cellIndex], let cell = collectionView.cellForItem(at: path) {
      UIGraphicsBeginImageContextWithOptions(cell.frame.size, true, 0)
      if let context = UIGraphicsGetCurrentContext() {
        cell.layer.render(in: context)
      }
      oldCellSnapshotView.image = UIGraphicsGetImageFromCurrentImageContext()
      addSubview(oldCellSnapshotView)
      oldCellSnapshotView.frame = oldCellFrame
      UIGraphicsEndImageContext()
    }
    
    // MARK: Snapshot of right side of collectionView
    if let path = paths[safe: cellIndex + 1], let cell = collectionView.cellForItem(at: path), !animationInProcess {
      UIGraphicsBeginImageContextWithOptions(cell.bounds.size, true, 0)
      if let context = UIGraphicsGetCurrentContext() {
        cell.layer.render(in: context)
      }
      oldRightSideSnapshotView.image = UIGraphicsGetImageFromCurrentImageContext()
      UIGraphicsEndImageContext()
      collectionView.addSubview(oldRightSideSnapshotView)
      oldRightSideSnapshotView.frame = CGRect(x: oldCellFrame.maxX + space, y: 0, width: cellFrame.width, height: cellFrame.height)
    }
    
    
