Skip to content

Commit

Permalink
Fix Apple TV TabBarIOS issue (facebook#15081)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglowder committed Jul 19, 2017
1 parent 1afee0b commit 6bdb585
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions React/Views/RCTTabBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ - (void)setItemPositioning:(UITabBarItemPositioning)itemPositioning

#pragma mark - UITabBarControllerDelegate

#if TARGET_OS_TV

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(nonnull UIViewController *)viewController
{
NSUInteger index = [tabBarController.viewControllers indexOfObject:viewController];
RCTTabBarItem *tab = (RCTTabBarItem *)self.reactSubviews[index];
if (tab.onPress) tab.onPress(nil);
return;
}

#else

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
{
NSUInteger index = [tabBarController.viewControllers indexOfObject:viewController];
Expand All @@ -183,6 +195,8 @@ - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectView
return NO;
}

#endif

#if TARGET_OS_TV

- (BOOL)isUserInteractionEnabled
Expand Down

0 comments on commit 6bdb585

Please sign in to comment.