             self.originalTagView = nil
         }
     }
+    
+    @objc private func handlePanItem(gestureRecognizer: UIPanGestureRecognizer) {
+        let location = gestureRecognizer.location(in: self.collectionView)
+        if let indexPath = self.collectionView.indexPathForItem(at: location) {
+            if indexPath.section != 6 {
+                return
+            }
+            
+            let ingredientTitle = self.ingredientTitles[indexPath.row]
+            var startX: CGFloat = 0
+            var offsetX: CGFloat = 0
+            if let cell = self.collectionView.cellForItem(at: indexPath) {
+                let cellSize = cell.frame.size
+                switch gestureRecognizer.state {
+                case .began:
+                    startX = location.x
+                case .changed:
+                    offsetX = location.x - startX
+                    cell.frame = CGRect(x: offsetX, y: cell.frame.origin.y, width: cell.frame.width, height: cell.frame.height)
+                case .ended:
+                    offsetX = location.x - startX
+                    if offsetX > 200 {
+                        ingredientTitles.remove(at: indexPath.row)
+                        self.collectionView.deleteItems(at: [indexPath])
+                        self.collectionView.reloadData()
+                    } else {
+                        cell.frame = CGRect(origin: CGPoint(x: 0, y: cell.frame.origin.y), size: cellSize)
+                    }
+                    startX = 0
+                    offsetX = 0
+                default:
+                    return
+                }
+            }
+        }
+    }
 
     private func distanceBetween(pointA: CGPoint, pointB: CGPoint) -> Double {
         let distanceX = Double(pointA.x - pointB.x)

    func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
        let location = touch.location(in: self.collectionView)
        if let indexPath = self.collectionView.indexPathForItem(at: location) {
            if indexPath.section == 4 {
                return true
            }
        }

        collectionView.register(UINib.init(nibName: mealItemViewCellIdentifier, bundle: nil), forCellWithReuseIdentifier: mealItemViewCellIdentifier)
        collectionView.delegate = self
        collectionView.dataSource = self
        let panTag = UIPanGestureRecognizer(target: self, action: #selector(handlePanTag(gestureRecognizer:)))
        panTag.delegate = self
        let panItem = UIPanGestureRecognizer(target: self, action: #selector(handlePanItem(gestureRecognizer:)))
        panItem.delegate = self
        collectionView.addGestureRecognizer(panTag)
        collectionView.addGestureRecognizer(panItem)
        collectionView.allowsMultipleSelection = true

    }
