I am making a simple basket application. I get an "out of range" error when deleting the product I added
CODE :
extension ViewController: CollectionViewCellDelegate {
func deleteBasket(Index2: Int) {
print("DELETED", Index2)
basketData.remove(at: Index2)
}
func updateBasket(Index: Int) {
print("ADDED", Index)
basketData.append(result[Index])
}
}
STORYBOARD :
