changed prop name currentViewStates to AccessibilityStates on iOS (3/3)

Summary:
Context:
After discussing with yungsters, `currentViewStates` is a very ambiguous name for a prop, especially because there are only two possible values. From a developer's perspective, it makes more sense to just call them `accessibilityStates` because the main use for them is to add states to Talkback and Voiceover.
Also, the actual implementation of what we're changing under the hood in Native Code is abstracted away from developers using React Native, so as long as behavior is as they would expect, it makes more sense to change the name into a clear one.

Changes in this Diff:
Renamed the view property exposed to native iOS code from `currentViewStates`  to `accessibilityStates`
Also deleted setting the userInteractionEnabled view property, because we want to keep it as just an accessibility property.

Reviewed By: PeteTheHeat

Differential Revision: D8896821

fbshipit-source-id: 95674c9b7295f5b9e60994c297acdee83f6226d7
This commit is contained in:
Ziqi Chen 2018-07-19 13:47:43 -07:00 committed by Facebook Github Bot
parent 3bedc78a35
commit ca01290d8e
1 changed files with 2 additions and 7 deletions

View File

@ -153,14 +153,9 @@ RCT_CUSTOM_VIEW_PROPERTY(accessibilityRole, UIAccessibilityTraits, RCTView)
view.reactAccessibilityElement.accessibilityTraits |= json ? [RCTConvert UIAccessibilityTraits:json] : defaultView.accessibilityTraits;
}
RCT_CUSTOM_VIEW_PROPERTY(currentViewStates, UIAccessibilityTraits, RCTView)
RCT_CUSTOM_VIEW_PROPERTY(accessibilityStates, UIAccessibilityTraits, RCTView)
{
UIAccessibilityTraits traits = json ? [RCTConvert UIAccessibilityTraits:json] : defaultView.accessibilityTraits;
view.reactAccessibilityElement.accessibilityTraits |= traits;
if (traits == UIAccessibilityTraitNotEnabled || traits == (UIAccessibilityTraitNotEnabled | UIAccessibilityTraitSelected))
{
view.userInteractionEnabled = NO;
}
view.reactAccessibilityElement.accessibilityTraits |= json ? [RCTConvert UIAccessibilityTraits:json] : defaultView.accessibilityTraits;
}
RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTPointerEvents, RCTView)