Example
self.accessibilityTraits |= UIAccessibilityTraitAdjustable;
adds the UIAccessibilityTraitAdjustable option. But how to remove an option from the mask like this, without having to set everything?
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
Try self.accessibilityTraits &= ~UIAccessibilityTraitAdjustable;
~
inverts the bits therefor the bits to be retained are 1 now and the bits to be cleared are 0. ANDing it with the left hand side variable will retain the bits which has 1s in the corresponding locations of ~UIAccessibilityTraitAdjustable
and will clear the bits which has 0s in the corresponding locations of ~UIAccessibilityTraitAdjustable
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With