Permalink
Browse files

Make testID work for iOS tabs

Reviewed By: shergin

Differential Revision: D6455054

fbshipit-source-id: 3c667b585e9332a1dbfff1fd3325f2c95985a5be
  • Loading branch information...
frantic authored and facebook-github-bot committed Dec 4, 2017
1 parent ca10604 commit e19d9dec9b3b257b5db3dc77ed8b95b93570f1e3
Showing with 7 additions and 0 deletions.
  1. +1 −0 React/Views/RCTTabBarItem.h
  2. +5 −0 React/Views/RCTTabBarItem.m
  3. +1 −0 React/Views/RCTTabBarItemManager.m
@@ -28,6 +28,7 @@
@property (nonatomic, assign, getter=isSelected) BOOL selected;
@property (nonatomic, readonly) UITabBarItem *barItem;
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
@property (nonatomic, strong) NSString *testID;
#if TARGET_OS_TV
@property (nonatomic, assign) BOOL wasSelectedInJS;
@@ -58,6 +58,11 @@ - (UITabBarItem *)barItem
return _barItem;
}
- (void)setTestID:(NSString *)testID
{
self.barItem.accessibilityIdentifier = testID;
}
- (void)setBadge:(id)badge
{
_badge = [badge copy];
@@ -30,6 +30,7 @@ - (UIView *)view
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(badgeColor, UIColor)
RCT_EXPORT_VIEW_PROPERTY(isTVSelectable, BOOL)
RCT_EXPORT_VIEW_PROPERTY(testID, NSString)
RCT_CUSTOM_VIEW_PROPERTY(title, NSString, RCTTabBarItem)
{
view.barItem.title = json ? [RCTConvert NSString:json] : defaultView.barItem.title;

0 comments on commit e19d9de

Please sign in to comment.