title: UICollectionView Cells Reordering
body: <p>I am trying to reorder my CollectionView Cells. But can't seem to get it past the UILongPressGestureRecognizer. The state goes from Began -> Changed -> Ended. But it's not going to the moveItemAtIndexPath function.
  Here is my Code:    </p>
  
  <pre><code>  func collectionView(collectionView: UICollectionView, moveItemAtIndexPath sourceIndexPath: NSIndexPath,toIndexPath destinationIndexPath: NSIndexPath) {
  
  var temp1 = [self.viewThatIsShown.selectionForView?.pageArray.count]
  
  let temp = temp1.removeAtIndex(sourceIndexPath.item)
  temp1.insert(temp, atIndex: destinationIndexPath.item)
  }
   func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
  
      let layout = self.viewThatIsShown.selectionForView!.rawJSON["pages"].arrayValue[section]["layout"].stringValue
  
      if layout == "video" || layout == "social-media" {
          return 1
      } else if layout == "pre-list" {
          let dataJSON = self.viewThatIsShown.selectionForView!.rawJSON["pages"].arrayValue[section]["data"]
          return dataJSON["listitems"].arrayValue.count
      }
  
      let dataSet = self.viewThatIsShown.dataForView!.dataArray[section]
  
      return min(dataSet.embeddedItemsArray.count, 2)
  
  }
   switch(gesture.state) {
  
      case UIGestureRecognizerState.Began:
          guard let selectedIndexPath = self.collectionView.indexPathForItemAtPoint(gesture.locationInView(self.collectionView)) else {
              break
          }
          collectionView.beginInteractiveMovementForItemAtIndexPath(selectedIndexPath)
      case UIGestureRecognizerState.Changed:
          collectionView.updateInteractiveMovementTargetPosition(gesture.locationInView(gesture.view!))
      case UIGestureRecognizerState.Ended:
          collectionView.endInteractiveMovement()
      default:
          collectionView.cancelInteractiveMovement()
      }
  </code></pre>
  
  <p>There is no error being shown as well. I think I am making some mistake in counting the number of Items in Section. But can't figure it out.
  P.S I have six sections in my UICollectionview which i want to use it for drag and drop section. </p>