I am trying to update the value of a variable (inside the function) inside the switch case construct. I am new to swift and am not sure I understand why it is not working.