title: UICollectionview - blink when move item
body: <p>I want to reorder my cells in my UICollectionView. But when I drop my item, the "cellForItemAt" method is called and this will cause the cell to flash (See image below). </p>
  
  <p>What should I do to avoid this behavior ?</p>
  
  <p>Thank you in advance for your help.</p>
  
  <p><a href="https://i.stack.imgur.com/ty8tR.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/ty8tR.gif" alt="enter image description here"></a></p>
  
  <pre><code> class ViewController: UIViewController {
  
      @IBOutlet weak var collectionView: UICollectionView!
  
      private let cellIdentifier = "cell"
      private let cells = [""]
  
      private var longPressGesture: UILongPressGestureRecognizer!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          longPressGesture = UILongPressGestureRecognizer(target: self, action: #selector(self.handleLongGesture(gesture:)))
          collectionView.addGestureRecognizer(longPressGesture)
      }
  
      //Selectors
      @objc func handleLongGesture(gesture: UILongPressGestureRecognizer) {
          switch(gesture.state) {
  
          case .began:
              guard let selectedIndexPath = collectionView.indexPathForItem(at: gesture.location(in: collectionView)) else {
                  break
              }
              collectionView.beginInteractiveMovementForItem(at: selectedIndexPath)
          case .changed:
              collectionView.updateInteractiveMovementTargetPosition(gesture.location(in: gesture.view!))
          case .ended:
              collectionView.endInteractiveMovement()
          default:
              collectionView.cancelInteractiveMovement()
          }
      }
  
  }
  
  // MARK: - UICollectionViewDataSource
  extension ViewController: UICollectionViewDataSource {
      func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
          return 10
      }
  
      func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
          let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellIdentifier, for: indexPath)
          return cell
      }
  
      func collectionView(_ collectionView: UICollectionView, canMoveItemAt indexPath: IndexPath) -&gt; Bool {
          return true
      }
  
      func collectionView(_ collectionView: UICollectionView, moveItemAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
      }
  }
  
  // MARK: - UICollectionViewDelegateFlowLayout
  extension ViewController: UICollectionViewDelegateFlowLayout {
      func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -&gt; CGSize {
          return CGSize(width: 100, height: 100)
      }
  }
  </code></pre>