Swift 5 out of range crash

Viewed 40

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 :

enter image description here

0 Answers
Related