Make testID work for iOS tabs
Reviewed By: shergin Differential Revision: D6455054 fbshipit-source-id: 3c667b585e9332a1dbfff1fd3325f2c95985a5be
This commit is contained in:
parent
ca106043fc
commit
e19d9dec9b
|
@ -28,6 +28,7 @@
|
||||||
@property (nonatomic, assign, getter=isSelected) BOOL selected;
|
@property (nonatomic, assign, getter=isSelected) BOOL selected;
|
||||||
@property (nonatomic, readonly) UITabBarItem *barItem;
|
@property (nonatomic, readonly) UITabBarItem *barItem;
|
||||||
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
||||||
|
@property (nonatomic, strong) NSString *testID;
|
||||||
|
|
||||||
#if TARGET_OS_TV
|
#if TARGET_OS_TV
|
||||||
@property (nonatomic, assign) BOOL wasSelectedInJS;
|
@property (nonatomic, assign) BOOL wasSelectedInJS;
|
||||||
|
|
|
@ -58,6 +58,11 @@ RCT_ENUM_CONVERTER(UITabBarSystemItem, (@{
|
||||||
return _barItem;
|
return _barItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setTestID:(NSString *)testID
|
||||||
|
{
|
||||||
|
self.barItem.accessibilityIdentifier = testID;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setBadge:(id)badge
|
- (void)setBadge:(id)badge
|
||||||
{
|
{
|
||||||
_badge = [badge copy];
|
_badge = [badge copy];
|
||||||
|
|
|
@ -30,6 +30,7 @@ RCT_EXPORT_VIEW_PROPERTY(systemIcon, UITabBarSystemItem)
|
||||||
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
||||||
RCT_EXPORT_VIEW_PROPERTY(badgeColor, UIColor)
|
RCT_EXPORT_VIEW_PROPERTY(badgeColor, UIColor)
|
||||||
RCT_EXPORT_VIEW_PROPERTY(isTVSelectable, BOOL)
|
RCT_EXPORT_VIEW_PROPERTY(isTVSelectable, BOOL)
|
||||||
|
RCT_EXPORT_VIEW_PROPERTY(testID, NSString)
|
||||||
RCT_CUSTOM_VIEW_PROPERTY(title, NSString, RCTTabBarItem)
|
RCT_CUSTOM_VIEW_PROPERTY(title, NSString, RCTTabBarItem)
|
||||||
{
|
{
|
||||||
view.barItem.title = json ? [RCTConvert NSString:json] : defaultView.barItem.title;
|
view.barItem.title = json ? [RCTConvert NSString:json] : defaultView.barItem.title;
|
||||||
|
|
Loading…
Reference in New Issue