Swift 4: Switch 0/1 int array values : I have next array

    [0, 0, 1, 1, 0, 0]

On some condition I have to switch 0 to 1 and vice versa

I am new in Switch and came from JS. In JS usually used code like:

    array[index] = !array[index]

However, in swift such coding does not working

Is there are an elegant way to do such convert with doing if-> else statements?