Repository: incubator-weex
Updated Branches:
  refs/heads/0.16-dev 5dbcb878d -> 254bc45ef


* [ios] support accessibilityhint


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/254bc45e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/254bc45e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/254bc45e

Branch: refs/heads/0.16-dev
Commit: 254bc45efada4477c8ad7097e6e8d75a9a7ba114
Parents: 5dbcb87
Author: acton393 <zhangxing610...@gmail.com>
Authored: Thu Sep 7 17:11:47 2017 +0800
Committer: acton393 <zhangxing610...@gmail.com>
Committed: Thu Sep 7 17:11:47 2017 +0800

----------------------------------------------------------------------
 .../WeexSDK/Sources/Component/WXComponent_internal.h  |  1 +
 ios/sdk/WeexSDK/Sources/Model/WXComponent.m           | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/254bc45e/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h 
b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
index 1452118..685ec07 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
+++ b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
@@ -68,6 +68,7 @@
     NSString * _ariaLabel; //accessibilityLabel
     NSString * _ariaHidden; // accessibilityElementsHidden
     NSString * _accessible; // accessible
+    NSString * _accessibilityHintContent; // hint for the action
     NSString * _testId;// just for auto-test
     
     /**

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/254bc45e/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m 
b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
index 81f8178..18e7d7c 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
@@ -93,6 +93,7 @@
         _isViewFrameSyncWithCalculated = YES;
         _ariaHidden = nil;
         _accessible = nil;
+        _accessibilityHintContent = nil;
         
         _async = NO;
         
@@ -120,6 +121,9 @@
         if (attributes[@"accessible"]) {
             _accessible = [WXConvert NSString:attributes[@"accessible"]];
         }
+        if(attributes[@"accessibilityHint"]) {
+            _accessibilityHintContent = [WXConvert 
NSString:attributes[@"accessibilityHint"]];
+        }
         
         if (attributes[@"testId"]) {
             _testId = [WXConvert NSString:attributes[@"testId"]];
@@ -262,6 +266,10 @@
             _view.accessibilityIdentifier = _testId;
         }
         
+        if (_accessibilityHintContent) {
+            [_view setAccessibilityHint:_accessibilityHintContent];
+        }
+        
         if (_ariaLabel) {
             _view.accessibilityLabel = _ariaLabel;
         }
@@ -603,7 +611,7 @@
 {
     WX_CHECK_COMPONENT_TYPE(self.componentType)
     
-    if (attributes[@"role"]){
+    if (attributes[@"role"]) {
         _role = [WXConvert WXUIAccessibilityTraits:attributes[@"role"]];
         self.view.accessibilityTraits = _role;
     }
@@ -619,6 +627,10 @@
         _ariaLabel = [WXConvert NSString:attributes[@"ariaLabel"]];
         self.view.accessibilityValue = _ariaLabel;
     }
+    if (attributes[@"accessibilityHint"]) {
+        _accessibilityHintContent = [WXConvert 
NSString:attributes[@"accessibilityHint"]];
+        [self.view setAccessibilityHint:_accessibilityHintContent];
+    }
     
     if (attributes[@"testId"]) {
         [self.view setAccessibilityIdentifier:[WXConvert 
NSString:attributes[@"testId"]]];

Reply via email to