 struct DragState {
     let listViewModel:SwiftBoardListViewModel
     let itemViewModel:SwiftBoardItemViewModel
-    let cell: SwiftBoardCell
     
     func indexOfItemInList() -> Int {
         return listViewModel.indexOfItem(itemViewModel)!

    private func endDrag() {
        if let dragState = currentDragState {
            let proxyState = dragProxyState!
            let cell = dragState.cell
            let collectionView = self
            
            UIView.animateWithDuration(0.2, animations: { () -> Void in
                proxyState.view.transform = CGAffineTransformIdentity
                proxyState.view.alpha = 1
                proxyState.view.frame = collectionView.convertRect(cell.frame, fromView: cell.superview)
            }, completion: { (Bool) -> Void in
                dragState.itemViewModel.dragging = false
                
                proxyState.view.removeFromSuperview()
                self.currentDragState = nil
                self.currentDropState = nil
            })
        }
    }
    

            
            if dropCell.pointInsideIcon(locationInCell) && dropCell is FolderCollectionViewCell {
                dropOperation = moveAppIntoFolder
            } else {
                var newIndex: Int
                
                if locationInCell.x < (dropCell.bounds.width / 2) {
                    newIndex = layout.indexToMoveSourceIndexLeftOfDestIndex(dragIndex, destIndex: dropIndex)
                } else {
                    newIndex = layout.indexToMoveSourceIndexRightOfDestIndex(dragIndex, destIndex: dropIndex)
                }
                
                currentDragState?.listViewModel.moveItemAtIndex(dragIndex, toIndex: newIndex)
                
                if let newCell = collectionView.cellForItemAtIndexPath(NSIndexPath(forItem: newIndex, inSection: 0)) {
                    dragProxyReturnToRect = convertRect(newCell.frame, fromView: newCell.superview)
                }
            }
        } else {
            if openFolderCollectionView != nil {
                if let folderViewModel = openFolderCollectionView!.listViewModel as? FolderViewModel {
                    rootViewModel?.closeFolder(folderViewModel)
                }
            }
        }
    }
    
