if self.bitmask |= flag adds an option, how to remove one?

c, ios, ipad, iphone, objective-c

Solution

And it with the complement of the flag:

self.accessibilityTraits &= ~UIAccessibilityTraitAdjustable;

If `self.accessibilityTraits` was:

  000110

and `UIAccessibilityTraitAdjustable` is:

  000100

(these values are examples; I haven't looked-up the real values)

then `self.accessibilityTraits &= ~UIAccessibilityTraitAdjustable;` is:

  000110
& 111011
= 000010

Problem

Example ``` self.accessibilityTraits |= UIAccessibilityTraitAdjustable; ``` adds the UIAccessibilityTraitAdjustable option. But how to remove an option from the mask like this, without having to set everything?

Original source