     }
     
     private func resetDrag() {
-        if let dragState = currentDragState {
-            dragState.itemViewModel.dragging = false
-            let proxyState = dragProxyState!
-        
-            proxyState.view.removeFromSuperview()
-            self.currentDragState = nil
-            self.currentDropState = nil
+        if let itemViewModel = draggingItemViewModel {
+            itemViewModel.dragging = false
+            
+            if let proxyState = dragProxyState {
+                proxyState.view.removeFromSuperview()
+            }
+        
+            draggingItemViewModel = nil
+            currentDropState = nil
         }
     }
     

    let locationInCell: CGPoint
}

struct DragState {
    let itemViewModel:SwiftBoardItemViewModel
    
    // TODO: hopefully not needed after refactoring to drag operations
    func indexOfItemInList() -> Int {
        return itemViewModel.listViewModel!.indexOfItem(itemViewModel)!
    }
}

struct DropState {
    let index: Int
    let cell: SwiftBoardCell

        case longPressRecognizer:
            return true
        case panAndStopGestureRecognizer:
            return draggingItemViewModel != nil
        default:
            return super.gestureRecognizerShouldBegin(gesture)
        }
