Swift toggle_state as number.