Xcode – getting error: Binary operator '==' cannot be applied to two 'x' operands, how to remove certain number of elements in this array of objects
I am trying to remove 3 of my yellow objects in my array 'deck'. The array is made of Cards objects. I used: var counter = 3 var newArr = arr.filter { if counter > 0, $0 == yellow {…