From 211a46e087213bc72c166a4332cd1d3d0fa01be2 Mon Sep 17 00:00:00 2001 From: Yogev Ben David Date: Wed, 26 Feb 2020 12:05:04 +0200 Subject: [PATCH] Bottom tabs appearance iOS 13 support (#5966) This commit fixes issues with BottomTabs text color on iOS 13 * Extract bottomTab options from base presenter * Add iOS 13 appearance support for bottomTabs and bottomTab --- lib/ios/BottomTabAppearancePresenter.h | 6 + lib/ios/BottomTabAppearancePresenter.m | 15 +++ lib/ios/BottomTabPresenter.h | 9 ++ lib/ios/BottomTabPresenter.m | 68 +++++++++++ lib/ios/BottomTabPresenterCreator.h | 8 ++ lib/ios/BottomTabPresenterCreator.m | 14 +++ lib/ios/BottomTabsAppearancePresenter.h | 7 ++ lib/ios/BottomTabsAppearancePresenter.m | 18 +++ lib/ios/BottomTabsPresenterCreator.h | 8 ++ lib/ios/BottomTabsPresenterCreator.m | 14 +++ lib/ios/RNNBasePresenter.m | 110 ++--------------- lib/ios/RNNBottomTabOptions.h | 1 + lib/ios/RNNBottomTabOptions.m | 21 ++++ lib/ios/RNNBottomTabsPresenter.h | 8 ++ lib/ios/RNNBottomTabsPresenter.m | 27 +++-- lib/ios/RNNControllerFactory.m | 3 +- lib/ios/RNNTabBarItemCreator.h | 4 + lib/ios/RNNTabBarItemCreator.m | 24 +++- .../project.pbxproj | 48 ++++++++ lib/ios/TabBarItemAppearanceCreator.h | 5 + lib/ios/TabBarItemAppearanceCreator.m | 13 ++ lib/ios/UITabBarController+RNNOptions.h | 2 - lib/ios/UITabBarController+RNNOptions.m | 4 - .../RNNBottomTabsPresenterTest.m} | 15 ++- .../NavigationTests/RNNBasePresenterTest.m | 2 +- .../RNNBottomTabsAppearancePresenterTest.m | 114 ++++++++++++++++++ .../RNNDotIndicatorPresenterTest.m | 2 +- .../UITabBarController+RNNOptionsTest.m | 19 +-- .../ios/playground.xcodeproj/project.pbxproj | 12 +- 29 files changed, 456 insertions(+), 145 deletions(-) create mode 100644 lib/ios/BottomTabAppearancePresenter.h create mode 100644 lib/ios/BottomTabAppearancePresenter.m create mode 100644 lib/ios/BottomTabPresenter.h create mode 100644 lib/ios/BottomTabPresenter.m create mode 100644 lib/ios/BottomTabPresenterCreator.h create mode 100644 lib/ios/BottomTabPresenterCreator.m create mode 100644 lib/ios/BottomTabsAppearancePresenter.h create mode 100644 lib/ios/BottomTabsAppearancePresenter.m create mode 100644 lib/ios/BottomTabsPresenterCreator.h create mode 100644 lib/ios/BottomTabsPresenterCreator.m create mode 100644 lib/ios/TabBarItemAppearanceCreator.h create mode 100644 lib/ios/TabBarItemAppearanceCreator.m rename playground/ios/{NavigationTests/RNNTabBarPresenterTest.m => NavigationIOS12Tests/RNNBottomTabsPresenterTest.m} (89%) create mode 100644 playground/ios/NavigationTests/RNNBottomTabsAppearancePresenterTest.m diff --git a/lib/ios/BottomTabAppearancePresenter.h b/lib/ios/BottomTabAppearancePresenter.h new file mode 100644 index 00000000000..928fdc2bee0 --- /dev/null +++ b/lib/ios/BottomTabAppearancePresenter.h @@ -0,0 +1,6 @@ +#import "BottomTabPresenter.h" + +API_AVAILABLE(ios(13.0)) +@interface BottomTabAppearancePresenter : BottomTabPresenter + +@end diff --git a/lib/ios/BottomTabAppearancePresenter.m b/lib/ios/BottomTabAppearancePresenter.m new file mode 100644 index 00000000000..182a57621ab --- /dev/null +++ b/lib/ios/BottomTabAppearancePresenter.m @@ -0,0 +1,15 @@ +#import "BottomTabAppearancePresenter.h" +#import "TabBarItemAppearanceCreator.h" + +@implementation BottomTabAppearancePresenter + +- (void)bindViewController:(UIViewController *)boundViewController { + [super bindViewController:boundViewController]; + boundViewController.tabBarItem.standardAppearance = [[UITabBarAppearance alloc] init]; +} + +- (void)updateTabBarItem:(UITabBarItem *)tabItem bottomTabOptions:(RNNBottomTabOptions *)bottomTabOptions { + self.boundViewController.tabBarItem = [TabBarItemAppearanceCreator updateTabBarItem:self.boundViewController.tabBarItem bottomTabOptions:bottomTabOptions]; +} + +@end diff --git a/lib/ios/BottomTabPresenter.h b/lib/ios/BottomTabPresenter.h new file mode 100644 index 00000000000..5d781e4e95a --- /dev/null +++ b/lib/ios/BottomTabPresenter.h @@ -0,0 +1,9 @@ +#import "RNNBasePresenter.h" + +@interface BottomTabPresenter : RNNBasePresenter + +- (instancetype)initWithDefaultOptions:(RNNNavigationOptions *)defaultOptions; + +- (void)applyDotIndicator:(UIViewController *)child; + +@end diff --git a/lib/ios/BottomTabPresenter.m b/lib/ios/BottomTabPresenter.m new file mode 100644 index 00000000000..e732fde1966 --- /dev/null +++ b/lib/ios/BottomTabPresenter.m @@ -0,0 +1,68 @@ +#import "BottomTabPresenter.h" +#import "RNNTabBarItemCreator.h" +#import "UIViewController+RNNOptions.h" +#import "RNNDotIndicatorPresenter.h" +#import "UIViewController+LayoutProtocol.h" + +@interface BottomTabPresenter () +@property(nonatomic, strong) RNNDotIndicatorPresenter* dotIndicatorPresenter; +@end + +@implementation BottomTabPresenter + +- (instancetype)initWithDefaultOptions:(RNNNavigationOptions *)defaultOptions { + self = [super init]; + self.defaultOptions = defaultOptions; + self.dotIndicatorPresenter = [[RNNDotIndicatorPresenter alloc] initWithDefaultOptions:defaultOptions]; + return self; +} + +- (void)applyOptions:(RNNNavigationOptions *)options { + RNNNavigationOptions * withDefault = [options withDefault:self.defaultOptions]; + + if (withDefault.bottomTab.badge.hasValue && [self.boundViewController.parentViewController isKindOfClass:[UITabBarController class]]) { + [self.boundViewController setTabBarItemBadge:withDefault.bottomTab.badge.get]; + } + + if (withDefault.bottomTab.badgeColor.hasValue && [self.boundViewController.parentViewController isKindOfClass:[UITabBarController class]]) { + [self.boundViewController setTabBarItemBadgeColor:withDefault.bottomTab.badgeColor.get]; + } +} + +- (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options { + RNNNavigationOptions * withDefault = [options withDefault:self.defaultOptions]; + + if (withDefault.bottomTab.hasValue) { + [self updateTabBarItem:self.boundViewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; + } +} + +- (void)mergeOptions:(RNNNavigationOptions *)options resolvedOptions:(RNNNavigationOptions *)resolvedOptions { + RNNNavigationOptions* withDefault = (RNNNavigationOptions *) [[resolvedOptions withDefault:self.defaultOptions] overrideOptions:options]; + + if (options.bottomTab.badge.hasValue) { + [self.boundViewController setTabBarItemBadge:options.bottomTab.badge.get]; + } + + if (options.bottomTab.badgeColor.hasValue && [self.boundViewController.parentViewController isKindOfClass:[UITabBarController class]]) { + [self.boundViewController setTabBarItemBadgeColor:options.bottomTab.badgeColor.get]; + } + + if ([options.bottomTab.dotIndicator hasValue] && [self.boundViewController.parentViewController isKindOfClass:[UITabBarController class]]) { + [[self dotIndicatorPresenter] apply:self.boundViewController:options.bottomTab.dotIndicator]; + } + + if (options.bottomTab.hasValue) { + [self updateTabBarItem:self.boundViewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; + } +} + +- (void)updateTabBarItem:(UITabBarItem *)tabItem bottomTabOptions:(RNNBottomTabOptions *)bottomTabOptions { + self.boundViewController.tabBarItem = [RNNTabBarItemCreator updateTabBarItem:self.boundViewController.tabBarItem bottomTabOptions:bottomTabOptions]; +} + +- (void)applyDotIndicator:(UIViewController *)child { + [_dotIndicatorPresenter apply:child:[child resolveOptions].bottomTab.dotIndicator]; +} + +@end diff --git a/lib/ios/BottomTabPresenterCreator.h b/lib/ios/BottomTabPresenterCreator.h new file mode 100644 index 00000000000..6291d319200 --- /dev/null +++ b/lib/ios/BottomTabPresenterCreator.h @@ -0,0 +1,8 @@ +#import +#import "BottomTabPresenter.h" + +@interface BottomTabPresenterCreator : NSObject + ++ (BottomTabPresenter *)createWithDefaultOptions:(RNNNavigationOptions *)defaultOptions; + +@end diff --git a/lib/ios/BottomTabPresenterCreator.m b/lib/ios/BottomTabPresenterCreator.m new file mode 100644 index 00000000000..7c29aacf067 --- /dev/null +++ b/lib/ios/BottomTabPresenterCreator.m @@ -0,0 +1,14 @@ +#import "BottomTabPresenterCreator.h" +#import "BottomTabAppearancePresenter.h" + +@implementation BottomTabPresenterCreator + ++ (BottomTabPresenter *)createWithDefaultOptions:(RNNNavigationOptions *)defaultOptions { + if (@available(iOS 13.0, *)) { + return [[BottomTabAppearancePresenter alloc] initWithDefaultOptions:defaultOptions]; + } else { + return [[BottomTabPresenter alloc] initWithDefaultOptions:defaultOptions]; + } +} + +@end diff --git a/lib/ios/BottomTabsAppearancePresenter.h b/lib/ios/BottomTabsAppearancePresenter.h new file mode 100644 index 00000000000..4f74f96402b --- /dev/null +++ b/lib/ios/BottomTabsAppearancePresenter.h @@ -0,0 +1,7 @@ +#import "RNNBottomTabsPresenter.h" + +API_AVAILABLE(ios(13.0)) +@interface BottomTabsAppearancePresenter : RNNBottomTabsPresenter + + +@end diff --git a/lib/ios/BottomTabsAppearancePresenter.m b/lib/ios/BottomTabsAppearancePresenter.m new file mode 100644 index 00000000000..9b15bf4644b --- /dev/null +++ b/lib/ios/BottomTabsAppearancePresenter.m @@ -0,0 +1,18 @@ +#import "BottomTabsAppearancePresenter.h" + +@implementation BottomTabsAppearancePresenter + +- (void)applyOptionsOnInit:(RNNNavigationOptions *)options { + [super applyOptionsOnInit:options]; + UITabBarController *bottomTabs = self.tabBarController; + bottomTabs.tabBar.standardAppearance = [UITabBarAppearance new]; +} + +- (void)setTabBarBackgroundColor:(UIColor *)backgroundColor { + UITabBarController *bottomTabs = self.tabBarController; + for (UIViewController* childViewController in bottomTabs.childViewControllers) { + childViewController.tabBarItem.standardAppearance.backgroundColor = backgroundColor; + } +} + +@end diff --git a/lib/ios/BottomTabsPresenterCreator.h b/lib/ios/BottomTabsPresenterCreator.h new file mode 100644 index 00000000000..5479d06b871 --- /dev/null +++ b/lib/ios/BottomTabsPresenterCreator.h @@ -0,0 +1,8 @@ +#import +#import "RNNBottomTabsPresenter.h" + +@interface BottomTabsPresenterCreator : NSObject + ++ (RNNBottomTabsPresenter *)createWithDefaultOptions:(RNNNavigationOptions *)defaultOptions; + +@end diff --git a/lib/ios/BottomTabsPresenterCreator.m b/lib/ios/BottomTabsPresenterCreator.m new file mode 100644 index 00000000000..9204ebb3a96 --- /dev/null +++ b/lib/ios/BottomTabsPresenterCreator.m @@ -0,0 +1,14 @@ +#import "BottomTabsPresenterCreator.h" +#import "BottomTabsAppearancePresenter.h" + +@implementation BottomTabsPresenterCreator + ++ (RNNBottomTabsPresenter *)createWithDefaultOptions:(RNNNavigationOptions *)defaultOptions { + if (@available(iOS 13.0, *)) { + return [[BottomTabsAppearancePresenter alloc] initWithDefaultOptions:defaultOptions]; + } else { + return [[RNNBottomTabsPresenter alloc] initWithDefaultOptions:defaultOptions]; + } +} + +@end diff --git a/lib/ios/RNNBasePresenter.m b/lib/ios/RNNBasePresenter.m index f93f5c9aa60..399c9b1bbf1 100644 --- a/lib/ios/RNNBasePresenter.m +++ b/lib/ios/RNNBasePresenter.m @@ -4,18 +4,18 @@ #import "RNNReactComponentRegistry.h" #import "UIViewController+LayoutProtocol.h" #import "DotIndicatorOptions.h" -#import "RNNDotIndicatorPresenter.h" #import "RCTConvert+Modal.h" +#import "BottomTabPresenterCreator.h" @interface RNNBasePresenter () -@property(nonatomic, strong) RNNDotIndicatorPresenter* dotIndicatorPresenter; +@property(nonatomic, strong) BottomTabPresenter* bottomTabPresenter; @end @implementation RNNBasePresenter - (instancetype)initWithDefaultOptions:(RNNNavigationOptions *)defaultOptions { self = [super init]; _defaultOptions = defaultOptions; - self.dotIndicatorPresenter = [[RNNDotIndicatorPresenter alloc] initWithDefaultOptions:_defaultOptions]; + _bottomTabPresenter = [BottomTabPresenterCreator createWithDefaultOptions:self.defaultOptions]; return self; } @@ -28,6 +28,7 @@ - (instancetype)initWithComponentRegistry:(RNNReactComponentRegistry *)component - (void)bindViewController:(UIViewController *)boundViewController { self.boundComponentId = boundViewController.layoutInfo.componentId; _boundViewController = boundViewController; + _bottomTabPresenter.boundViewController = boundViewController; } - (void)setDefaultOptions:(RNNNavigationOptions *)defaultOptions { @@ -60,113 +61,18 @@ - (void)applyOptionsOnViewDidLayoutSubviews:(RNNNavigationOptions *)options { } - (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options { - UIViewController *viewController = self.boundViewController; - RNNNavigationOptions * withDefault = [options withDefault:_defaultOptions]; - - if (withDefault.bottomTab.text.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (withDefault.bottomTab.icon.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (withDefault.bottomTab.selectedIcon.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (withDefault.bottomTab.badgeColor.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (withDefault.bottomTab.textColor.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (withDefault.bottomTab.iconColor.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (withDefault.bottomTab.selectedTextColor.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (withDefault.bottomTab.selectedIconColor.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } + [_bottomTabPresenter applyOptionsOnWillMoveToParentViewController:options]; } - (void)applyOptions:(RNNNavigationOptions *)options { - UIViewController *viewController = self.boundViewController; - RNNNavigationOptions * withDefault = [options withDefault:_defaultOptions]; - - if (withDefault.bottomTab.badge.hasValue && [viewController.parentViewController isKindOfClass:[UITabBarController class]]) { - [viewController setTabBarItemBadge:withDefault.bottomTab.badge.get]; - } - - if (withDefault.bottomTab.badgeColor.hasValue && [viewController.parentViewController isKindOfClass:[UITabBarController class]]) { - [viewController setTabBarItemBadgeColor:withDefault.bottomTab.badgeColor.get]; - } + [_bottomTabPresenter applyOptions:options]; } - (void)mergeOptions:(RNNNavigationOptions *)options resolvedOptions:(RNNNavigationOptions *)resolvedOptions { UIViewController* viewController = self.boundViewController; RNNNavigationOptions* withDefault = (RNNNavigationOptions *) [[resolvedOptions withDefault:_defaultOptions] overrideOptions:options]; - if (options.bottomTab.badge.hasValue) { - [viewController setTabBarItemBadge:options.bottomTab.badge.get]; - } - - if (options.bottomTab.badgeColor.hasValue && [viewController.parentViewController isKindOfClass:[UITabBarController class]]) { - [viewController setTabBarItemBadgeColor:options.bottomTab.badgeColor.get]; - } - - if ([options.bottomTab.dotIndicator hasValue] && [viewController.parentViewController isKindOfClass:[UITabBarController class]]) { - [[self dotIndicatorPresenter] apply:viewController:options.bottomTab.dotIndicator]; - } - - if (options.bottomTab.text.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (options.bottomTab.icon.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (options.bottomTab.selectedIcon.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (options.bottomTab.textColor.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (options.bottomTab.selectedTextColor.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (options.bottomTab.iconColor.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } - - if (options.bottomTab.selectedIconColor.hasValue) { - UITabBarItem *tabItem = [RNNTabBarItemCreator updateTabBarItem:viewController.tabBarItem bottomTabOptions:withDefault.bottomTab]; - viewController.tabBarItem = tabItem; - } + [_bottomTabPresenter mergeOptions:options resolvedOptions:resolvedOptions]; if (options.window.backgroundColor.hasValue) { UIApplication.sharedApplication.delegate.window.backgroundColor = withDefault.window.backgroundColor.get; @@ -185,7 +91,7 @@ - (void)viewDidLayoutSubviews { } - (void)applyDotIndicator:(UIViewController *)child { - [[self dotIndicatorPresenter] apply:child:[child resolveOptions].bottomTab.dotIndicator]; + [_bottomTabPresenter applyDotIndicator:child]; } - (UIStatusBarStyle)getStatusBarStyle:(RNNNavigationOptions *)resolvedOptions { diff --git a/lib/ios/RNNBottomTabOptions.h b/lib/ios/RNNBottomTabOptions.h index 2277376ee1b..e44b91e8a21 100644 --- a/lib/ios/RNNBottomTabOptions.h +++ b/lib/ios/RNNBottomTabOptions.h @@ -23,5 +23,6 @@ @property(nonatomic, strong) Bool *visible; @property(nonatomic, strong) Bool *selectTabOnPress; +- (BOOL)hasValue; @end diff --git a/lib/ios/RNNBottomTabOptions.m b/lib/ios/RNNBottomTabOptions.m index 23ef6861440..a73f4eb0937 100644 --- a/lib/ios/RNNBottomTabOptions.m +++ b/lib/ios/RNNBottomTabOptions.m @@ -32,4 +32,25 @@ - (instancetype)initWithDict:(NSDictionary *)dict { return self; } +- (BOOL)hasValue { + return + self.text.hasValue || + self.badge.hasValue || + self.badgeColor.hasValue || + self.fontFamily.hasValue || + self.fontWeight.hasValue || + self.fontSize.hasValue || + self.testID.hasValue || + self.icon.hasValue || + self.selectedIcon.hasValue || + self.iconColor.hasValue || + self.selectedIconColor.hasValue || + self.selectedTextColor.hasValue || + self.iconInsets.hasValue || + self.textColor.hasValue || + self.visible.hasValue || + self.selectTabOnPress.hasValue; + +} + @end diff --git a/lib/ios/RNNBottomTabsPresenter.h b/lib/ios/RNNBottomTabsPresenter.h index 02393f06eff..83c89712a46 100644 --- a/lib/ios/RNNBottomTabsPresenter.h +++ b/lib/ios/RNNBottomTabsPresenter.h @@ -1,5 +1,13 @@ #import "RNNBasePresenter.h" @interface RNNBottomTabsPresenter : RNNBasePresenter + - (void)applyDotIndicator; + +- (void)setTabBarBackgroundColor:(UIColor *)backgroundColor; + +- (UITabBarController *)tabBarController; + +- (UITabBar *)tabBar; + @end diff --git a/lib/ios/RNNBottomTabsPresenter.m b/lib/ios/RNNBottomTabsPresenter.m index 9561453e921..34d298c4c47 100644 --- a/lib/ios/RNNBottomTabsPresenter.m +++ b/lib/ios/RNNBottomTabsPresenter.m @@ -7,7 +7,7 @@ @implementation RNNBottomTabsPresenter - (void)applyOptionsOnInit:(RNNNavigationOptions *)options { [super applyOptionsOnInit:options]; - UITabBarController *bottomTabs = self.boundViewController; + UITabBarController *bottomTabs = self.tabBarController; RNNNavigationOptions *withDefault = [options withDefault:[self defaultOptions]]; [bottomTabs setCurrentTabIndex:[withDefault.bottomTabs.currentTabIndex getWithDefaultValue:0]]; if ([[withDefault.bottomTabs.titleDisplayMode getWithDefaultValue:@"alwaysShow"] isEqualToString:@"alwaysHide"]) { @@ -16,21 +16,22 @@ - (void)applyOptionsOnInit:(RNNNavigationOptions *)options { } - (void)applyOptions:(RNNNavigationOptions *)options { - UITabBarController *bottomTabs = self.boundViewController; + UITabBarController *bottomTabs = self.tabBarController; RNNNavigationOptions *withDefault = [options withDefault:[self defaultOptions]]; [bottomTabs setTabBarTestID:[withDefault.bottomTabs.testID getWithDefaultValue:nil]]; - [bottomTabs setTabBarBackgroundColor:[withDefault.bottomTabs.backgroundColor getWithDefaultValue:nil]]; + [bottomTabs setTabBarVisible:[withDefault.bottomTabs.visible getWithDefaultValue:YES] animated:[withDefault.bottomTabs.animate getWithDefaultValue:NO]]; + + [bottomTabs.view setBackgroundColor:[withDefault.layout.backgroundColor getWithDefaultValue:nil]]; + [self setTabBarBackgroundColor:[withDefault.bottomTabs.backgroundColor getWithDefaultValue:UIColor.whiteColor]]; [bottomTabs setTabBarTranslucent:[withDefault.bottomTabs.translucent getWithDefaultValue:NO]]; [bottomTabs setTabBarHideShadow:[withDefault.bottomTabs.hideShadow getWithDefaultValue:NO]]; [bottomTabs setTabBarStyle:[RCTConvert UIBarStyle:[withDefault.bottomTabs.barStyle getWithDefaultValue:@"default"]]]; - [bottomTabs setTabBarVisible:[withDefault.bottomTabs.visible getWithDefaultValue:YES] animated:[withDefault.bottomTabs.animate getWithDefaultValue:NO]]; - [bottomTabs.view setBackgroundColor:[withDefault.layout.backgroundColor getWithDefaultValue:nil]]; } - (void)mergeOptions:(RNNNavigationOptions *)options resolvedOptions:(RNNNavigationOptions *)currentOptions { [super mergeOptions:options resolvedOptions:currentOptions]; - UITabBarController *bottomTabs = self.boundViewController; + UITabBarController *bottomTabs = self.tabBarController; if (options.bottomTabs.currentTabIndex.hasValue) { [bottomTabs setCurrentTabIndex:options.bottomTabs.currentTabIndex.get]; @@ -47,7 +48,7 @@ - (void)mergeOptions:(RNNNavigationOptions *)options resolvedOptions:(RNNNavigat } if (options.bottomTabs.backgroundColor.hasValue) { - [bottomTabs setTabBarBackgroundColor:options.bottomTabs.backgroundColor.get]; + [self setTabBarBackgroundColor:options.bottomTabs.backgroundColor.get]; } if (options.bottomTabs.barStyle.hasValue) { @@ -75,6 +76,18 @@ - (void)mergeOptions:(RNNNavigationOptions *)options resolvedOptions:(RNNNavigat } } +- (void)setTabBarBackgroundColor:(UIColor *)backgroundColor { + self.tabBar.barTintColor = backgroundColor; +} + +- (UITabBarController *)tabBarController { + return (UITabBarController *)self.boundViewController; +} + +- (UITabBar *)tabBar { + return self.tabBarController.tabBar; +} + - (void)viewDidLayoutSubviews { dispatch_async(dispatch_get_main_queue(), ^{ [self applyDotIndicator]; diff --git a/lib/ios/RNNControllerFactory.m b/lib/ios/RNNControllerFactory.m index 559db3fe430..dbfd4bea4cf 100644 --- a/lib/ios/RNNControllerFactory.m +++ b/lib/ios/RNNControllerFactory.m @@ -8,6 +8,7 @@ #import "RNNExternalViewController.h" #import "BottomTabsBaseAttacher.h" #import "BottomTabsAttachModeFactory.h" +#import "BottomTabsPresenterCreator.h" @implementation RNNControllerFactory { id _creator; @@ -148,7 +149,7 @@ - (UIViewController *)createStack:(RNNLayoutNode*)node { - (UIViewController *)createBottomTabs:(RNNLayoutNode*)node { RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] initWithNode:node]; RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:node.data[@"options"]]; - RNNBottomTabsPresenter* presenter = [[RNNBottomTabsPresenter alloc] initWithDefaultOptions:_defaultOptions]; + RNNBottomTabsPresenter* presenter = [BottomTabsPresenterCreator createWithDefaultOptions:_defaultOptions]; BottomTabsBaseAttacher* bottomTabsAttacher = [_bottomTabsAttachModeFactory fromOptions:options]; NSArray *childViewControllers = [self extractChildrenViewControllersFromNode:node]; diff --git a/lib/ios/RNNTabBarItemCreator.h b/lib/ios/RNNTabBarItemCreator.h index 2f3559d1df8..b9a9eddb480 100644 --- a/lib/ios/RNNTabBarItemCreator.h +++ b/lib/ios/RNNTabBarItemCreator.h @@ -6,4 +6,8 @@ + (UITabBarItem *)updateTabBarItem:(UITabBarItem *)tabItem bottomTabOptions:(RNNBottomTabOptions *)bottomTabOptions; ++ (void)setTitleAttributes:(UITabBarItem *)tabItem titleAttributes:(NSDictionary *)titleAttributes; + ++ (void)setSelectedTitleAttributes:(UITabBarItem *)tabItem selectedTitleAttributes:(NSDictionary *)selectedTitleAttributes; + @end diff --git a/lib/ios/RNNTabBarItemCreator.m b/lib/ios/RNNTabBarItemCreator.m index 793d393d419..d3f7fff1b7d 100644 --- a/lib/ios/RNNTabBarItemCreator.m +++ b/lib/ios/RNNTabBarItemCreator.m @@ -31,9 +31,7 @@ + (UITabBarItem *)updateTabBarItem:(UITabBarItem *)tabItem bottomTabOptions:(RNN tabItem.imageInsets = UIEdgeInsetsMake(top, left, bottom, right); } - - - [self appendTitleAttributes:tabItem textColor:[bottomTabOptions.textColor getWithDefaultValue:nil] selectedTextColor:[bottomTabOptions.selectedTextColor getWithDefaultValue:nil] fontFamily:[bottomTabOptions.fontFamily getWithDefaultValue:nil] fontSize:[bottomTabOptions.fontSize getWithDefaultValue:nil] fontWeight:[bottomTabOptions.fontWeight getWithDefaultValue:nil]]; + [self appendTitleAttributes:tabItem bottomTabOptions:bottomTabOptions]; return tabItem; } @@ -62,13 +60,27 @@ + (UIImage *)getIconImage:(UIImage *)icon withTint:(UIColor *)tintColor { return nil; } -+ (void)appendTitleAttributes:(UITabBarItem *)tabItem textColor:(UIColor *)textColor selectedTextColor:(UIColor *)selectedTextColor fontFamily:(NSString *)fontFamily fontSize:(NSNumber *)fontSize fontWeight:(NSString *)fontWeight { ++ (void)appendTitleAttributes:(UITabBarItem *)tabItem bottomTabOptions:(RNNBottomTabOptions *)bottomTabOptions { + UIColor* textColor = [bottomTabOptions.textColor getWithDefaultValue:nil]; + UIColor* selectedTextColor = [bottomTabOptions.selectedTextColor getWithDefaultValue:nil]; + NSString* fontFamily = [bottomTabOptions.fontFamily getWithDefaultValue:nil]; + NSNumber* fontSize = [bottomTabOptions.fontSize getWithDefaultValue:nil]; + NSString* fontWeight = [bottomTabOptions.fontWeight getWithDefaultValue:nil]; + NSDictionary* selectedAttributes = [RNNFontAttributesCreator createFromDictionary:[tabItem titleTextAttributesForState:UIControlStateSelected] fontFamily:fontFamily fontSize:fontSize defaultFontSize:@(10) fontWeight:fontWeight color:selectedTextColor defaultColor:[UIColor blackColor]]; - [tabItem setTitleTextAttributes:selectedAttributes forState:UIControlStateSelected]; + [self setSelectedTitleAttributes:tabItem selectedTitleAttributes:selectedAttributes]; NSDictionary* normalAttributes = [RNNFontAttributesCreator createFromDictionary:[tabItem titleTextAttributesForState:UIControlStateNormal] fontFamily:fontFamily fontSize:fontSize defaultFontSize:@(10) fontWeight:fontWeight color:textColor defaultColor:[UIColor blackColor]]; - [tabItem setTitleTextAttributes:normalAttributes forState:UIControlStateNormal]; + [self setTitleAttributes:tabItem titleAttributes:normalAttributes]; +} + ++ (void)setTitleAttributes:(UITabBarItem *)tabItem titleAttributes:(NSDictionary *)titleAttributes { + [tabItem setTitleTextAttributes:titleAttributes forState:UIControlStateNormal]; +} + ++ (void)setSelectedTitleAttributes:(UITabBarItem *)tabItem selectedTitleAttributes:(NSDictionary *)selectedTitleAttributes { + [tabItem setTitleTextAttributes:selectedTitleAttributes forState:UIControlStateSelected]; } @end diff --git a/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj b/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj index 7143e9f971d..787f5bb8159 100644 --- a/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj +++ b/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj @@ -91,6 +91,18 @@ 501E0217213E7EA3003365C5 /* RNNReactView.h in Headers */ = {isa = PBXBuildFile; fileRef = 501E0215213E7EA3003365C5 /* RNNReactView.h */; }; 501E0218213E7EA3003365C5 /* RNNReactView.m in Sources */ = {isa = PBXBuildFile; fileRef = 501E0216213E7EA3003365C5 /* RNNReactView.m */; }; 50206A6D21AFE75400B7BB1A /* RNNSideMenuParserTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 50206A6C21AFE75400B7BB1A /* RNNSideMenuParserTest.m */; }; + 5022EDB52405224B00852BA6 /* BottomTabPresenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 5022EDB32405224B00852BA6 /* BottomTabPresenter.h */; }; + 5022EDB62405224B00852BA6 /* BottomTabPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 5022EDB42405224B00852BA6 /* BottomTabPresenter.m */; }; + 5022EDB92405226800852BA6 /* BottomTabAppearancePresenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 5022EDB72405226800852BA6 /* BottomTabAppearancePresenter.h */; }; + 5022EDBA2405226800852BA6 /* BottomTabAppearancePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 5022EDB82405226800852BA6 /* BottomTabAppearancePresenter.m */; }; + 5022EDBD2405237100852BA6 /* BottomTabPresenterCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = 5022EDBB2405237100852BA6 /* BottomTabPresenterCreator.h */; }; + 5022EDBE2405237100852BA6 /* BottomTabPresenterCreator.m in Sources */ = {isa = PBXBuildFile; fileRef = 5022EDBC2405237100852BA6 /* BottomTabPresenterCreator.m */; }; + 5022EDC124053C9F00852BA6 /* TabBarItemAppearanceCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = 5022EDBF24053C9F00852BA6 /* TabBarItemAppearanceCreator.h */; }; + 5022EDC224053C9F00852BA6 /* TabBarItemAppearanceCreator.m in Sources */ = {isa = PBXBuildFile; fileRef = 5022EDC024053C9F00852BA6 /* TabBarItemAppearanceCreator.m */; }; + 5022EDC524054C6100852BA6 /* BottomTabsAppearancePresenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 5022EDC324054C6100852BA6 /* BottomTabsAppearancePresenter.h */; }; + 5022EDC624054C6100852BA6 /* BottomTabsAppearancePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 5022EDC424054C6100852BA6 /* BottomTabsAppearancePresenter.m */; }; + 5022EDC924054C8A00852BA6 /* BottomTabsPresenterCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = 5022EDC724054C8A00852BA6 /* BottomTabsPresenterCreator.h */; }; + 5022EDCA24054C8A00852BA6 /* BottomTabsPresenterCreator.m in Sources */ = {isa = PBXBuildFile; fileRef = 5022EDC824054C8A00852BA6 /* BottomTabsPresenterCreator.m */; }; 502CB46E20CD1DDA0019B2FE /* RNNBackButtonOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 502CB46C20CD1DDA0019B2FE /* RNNBackButtonOptions.h */; }; 502CB46F20CD1DDA0019B2FE /* RNNBackButtonOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 502CB46D20CD1DDA0019B2FE /* RNNBackButtonOptions.m */; }; 502F0E142178CF8200367CC3 /* UIViewController+RNNOptionsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 502F0E132178CF8200367CC3 /* UIViewController+RNNOptionsTest.m */; }; @@ -561,6 +573,18 @@ 501E0215213E7EA3003365C5 /* RNNReactView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNReactView.h; sourceTree = ""; }; 501E0216213E7EA3003365C5 /* RNNReactView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNReactView.m; sourceTree = ""; }; 50206A6C21AFE75400B7BB1A /* RNNSideMenuParserTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuParserTest.m; sourceTree = ""; }; + 5022EDB32405224B00852BA6 /* BottomTabPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BottomTabPresenter.h; sourceTree = ""; }; + 5022EDB42405224B00852BA6 /* BottomTabPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BottomTabPresenter.m; sourceTree = ""; }; + 5022EDB72405226800852BA6 /* BottomTabAppearancePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BottomTabAppearancePresenter.h; sourceTree = ""; }; + 5022EDB82405226800852BA6 /* BottomTabAppearancePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BottomTabAppearancePresenter.m; sourceTree = ""; }; + 5022EDBB2405237100852BA6 /* BottomTabPresenterCreator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BottomTabPresenterCreator.h; sourceTree = ""; }; + 5022EDBC2405237100852BA6 /* BottomTabPresenterCreator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BottomTabPresenterCreator.m; sourceTree = ""; }; + 5022EDBF24053C9F00852BA6 /* TabBarItemAppearanceCreator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TabBarItemAppearanceCreator.h; sourceTree = ""; }; + 5022EDC024053C9F00852BA6 /* TabBarItemAppearanceCreator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TabBarItemAppearanceCreator.m; sourceTree = ""; }; + 5022EDC324054C6100852BA6 /* BottomTabsAppearancePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BottomTabsAppearancePresenter.h; sourceTree = ""; }; + 5022EDC424054C6100852BA6 /* BottomTabsAppearancePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BottomTabsAppearancePresenter.m; sourceTree = ""; }; + 5022EDC724054C8A00852BA6 /* BottomTabsPresenterCreator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BottomTabsPresenterCreator.h; sourceTree = ""; }; + 5022EDC824054C8A00852BA6 /* BottomTabsPresenterCreator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BottomTabsPresenterCreator.m; sourceTree = ""; }; 502CB43920CBCA140019B2FE /* RNNBridgeManagerDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNBridgeManagerDelegate.h; sourceTree = ""; }; 502CB46C20CD1DDA0019B2FE /* RNNBackButtonOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNBackButtonOptions.h; sourceTree = ""; }; 502CB46D20CD1DDA0019B2FE /* RNNBackButtonOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNBackButtonOptions.m; sourceTree = ""; }; @@ -991,6 +1015,8 @@ 5030B62823D5C9AF008F1642 /* RCTConvert+Interpolation.h */, 5038A3BB216E1490009280BC /* RNNTabBarItemCreator.h */, 5038A3BC216E1490009280BC /* RNNTabBarItemCreator.m */, + 5022EDBF24053C9F00852BA6 /* TabBarItemAppearanceCreator.h */, + 5022EDC024053C9F00852BA6 /* TabBarItemAppearanceCreator.m */, 5053CE7D2175FB1900D0386B /* RNNDefaultOptionsHelper.h */, 5053CE7E2175FB1900D0386B /* RNNDefaultOptionsHelper.m */, C2A57A1A21E815F80066711C /* InteractivePopGestureDelegate.h */, @@ -1360,6 +1386,16 @@ 50CED450239F9DFC00C42EE2 /* TopBarPresenter.m */, 505C640023E074860078AFC0 /* TopBarTitlePresenter.h */, 505C640123E074860078AFC0 /* TopBarTitlePresenter.m */, + 5022EDB32405224B00852BA6 /* BottomTabPresenter.h */, + 5022EDB42405224B00852BA6 /* BottomTabPresenter.m */, + 5022EDB72405226800852BA6 /* BottomTabAppearancePresenter.h */, + 5022EDB82405226800852BA6 /* BottomTabAppearancePresenter.m */, + 5022EDC324054C6100852BA6 /* BottomTabsAppearancePresenter.h */, + 5022EDC424054C6100852BA6 /* BottomTabsAppearancePresenter.m */, + 5022EDBB2405237100852BA6 /* BottomTabPresenterCreator.h */, + 5022EDBC2405237100852BA6 /* BottomTabPresenterCreator.m */, + 5022EDC724054C8A00852BA6 /* BottomTabsPresenterCreator.h */, + 5022EDC824054C8A00852BA6 /* BottomTabsPresenterCreator.m */, ); name = Presenters; sourceTree = ""; @@ -1636,6 +1672,7 @@ 5060DE74219DAD8300D0C052 /* RNNBridgeManagerDelegate.h in Headers */, 5060DE73219DAD7E00D0C052 /* ReactNativeNavigation.h in Headers */, 261F0E6A1E6F028A00989DE2 /* RNNNavigationStackManager.h in Headers */, + 5022EDBD2405237100852BA6 /* BottomTabPresenterCreator.h in Headers */, 507ACB1523F44E5200829911 /* RNNComponentRootView.h in Headers */, 5061B6C723D48449008B9827 /* VerticalRotationTransition.h in Headers */, 50EB4ED72068EBE000D6ED34 /* RNNBackgroundOptions.h in Headers */, @@ -1679,6 +1716,7 @@ 5012240A21735959000F5F98 /* RNNSideMenuPresenter.h in Headers */, 50E02BDD21A6EE7900A43942 /* SideMenuOpenGestureModeParser.h in Headers */, 50A5628E23DDAB6F0027C219 /* ModalTransitionDelegate.h in Headers */, + 5022EDB52405224B00852BA6 /* BottomTabPresenter.h in Headers */, 5038A3B5216DF602009280BC /* UINavigationController+RNNOptions.h in Headers */, 50E5F78D223F9FAF002AFEAD /* ElementTransitionOptions.h in Headers */, 509416AB23A11CB20036092C /* NullEnum.h in Headers */, @@ -1694,10 +1732,12 @@ 505EDD34214E7B7B0071C7DE /* RNNLeafProtocol.h in Headers */, 507ACB1123F44D1E00829911 /* RNNComponentView.h in Headers */, 263905B51E4C6F440023D7D3 /* MMExampleDrawerVisualStateManager.h in Headers */, + 5022EDB92405226800852BA6 /* BottomTabAppearancePresenter.h in Headers */, 50451D052042DAEB00695F00 /* RNNPushAnimation.h in Headers */, 507F43C51FF4F17C00D9425B /* RNNTopTabsViewController.h in Headers */, 501223D72173590F000F5F98 /* RNNStackPresenter.h in Headers */, 50495946216F5FB5006D2B81 /* TextParser.h in Headers */, + 5022EDC524054C6100852BA6 /* BottomTabsAppearancePresenter.h in Headers */, 503A8A1923BCB2ED0094D1C4 /* RNNReactButtonView.h in Headers */, 505EDD3C214FA8000071C7DE /* RNNComponentPresenter.h in Headers */, 502CB46E20CD1DDA0019B2FE /* RNNBackButtonOptions.h in Headers */, @@ -1761,6 +1801,7 @@ 5017D9E6239D2D9E00B74047 /* BottomTabsBaseAttacher.h in Headers */, 4534E72520CB6724009F8185 /* RNNLargeTitleOptions.h in Headers */, 390AD477200F499D00A8250D /* RNNSwizzles.h in Headers */, + 5022EDC924054C8A00852BA6 /* BottomTabsPresenterCreator.h in Headers */, 263905B11E4C6F440023D7D3 /* MMDrawerController.h in Headers */, 263905B31E4C6F440023D7D3 /* MMDrawerVisualState.h in Headers */, 50451D092042E20600695F00 /* RNNAnimationsOptions.h in Headers */, @@ -1778,6 +1819,7 @@ 5030B62723D5B54E008F1642 /* LNInterpolable.h in Headers */, 50EA541623AEDF5D006F881A /* RNNInterpolator.h in Headers */, 5017D9EE239D2FAF00B74047 /* BottomTabsAfterInitialTabAttacher.h in Headers */, + 5022EDC124053C9F00852BA6 /* TabBarItemAppearanceCreator.h in Headers */, 50395593217485B000B0A663 /* Double.h in Headers */, 5050465421F8F4490035497A /* RNNReactComponentRegistry.h in Headers */, 504AFE741FFFF0540076E904 /* RNNTopTabsOptions.h in Headers */, @@ -1970,6 +2012,7 @@ 5012241B21736678000F5F98 /* Image.m in Sources */, 50DE2E46238EA14E005CD5F4 /* NSArray+utils.m in Sources */, 50495943216F5E5D006D2B81 /* NullBool.m in Sources */, + 5022EDBE2405237100852BA6 /* BottomTabPresenterCreator.m in Sources */, 5038A3C7216E2D93009280BC /* Number.m in Sources */, E5F6C3A622DB4D0F0093C2CE /* UIViewController+Utils.m in Sources */, 5048862E20BE976D000908DE /* RNNLayoutOptions.m in Sources */, @@ -1984,6 +2027,7 @@ 261F0E6B1E6F028A00989DE2 /* RNNNavigationStackManager.m in Sources */, 5016E8F020209690009D4F7C /* RNNCustomTitleView.m in Sources */, 5061B6C823D48449008B9827 /* VerticalRotationTransition.m in Sources */, + 5022EDB62405224B00852BA6 /* BottomTabPresenter.m in Sources */, 503955982174864E00B0A663 /* NullDouble.m in Sources */, E8DA24411F97459B00CD552B /* RNNElementFinder.m in Sources */, 503A8A2223BCE9C60094D1C4 /* RNNReactBackgroundView.m in Sources */, @@ -1996,6 +2040,7 @@ 50495953216F62BD006D2B81 /* NullNumber.m in Sources */, 50D3A36F23B8D6C600717F95 /* SharedElementTransitionsCreator.m in Sources */, 5012242721737278000F5F98 /* NullImage.m in Sources */, + 5022EDC624054C6100852BA6 /* BottomTabsAppearancePresenter.m in Sources */, 7B1126A01E2D263F00F9B03B /* RNNEventEmitter.m in Sources */, A7626BFD1FC2FB2C00492FB8 /* RNNTopBarOptions.m in Sources */, 5050465521F8F4490035497A /* RNNReactComponentRegistry.m in Sources */, @@ -2010,6 +2055,7 @@ 390AD478200F499D00A8250D /* RNNSwizzles.m in Sources */, 50E02BD921A6EE0F00A43942 /* SideMenuOpenMode.m in Sources */, 503A8A0E23BC9BC50094D1C4 /* ElementVerticalTransition.m in Sources */, + 5022EDBA2405226800852BA6 /* BottomTabAppearancePresenter.m in Sources */, 5030B62C23D5D732008F1642 /* ContentTransitionCreator.m in Sources */, 7BA500751E2544B9001B9E1B /* ReactNativeNavigation.m in Sources */, 50E5F7962240EBD6002AFEAD /* RNNAnimationsTransitionDelegate.m in Sources */, @@ -2064,6 +2110,7 @@ 50D4656E23CE2553005A84B2 /* Transition.m in Sources */, 263905D71E4C94970023D7D3 /* RNNSideMenuController.m in Sources */, 50EB4ED82068EBE000D6ED34 /* RNNBackgroundOptions.m in Sources */, + 5022EDCA24054C8A00852BA6 /* BottomTabsPresenterCreator.m in Sources */, 507F43CA1FF4F9CC00D9425B /* RNNTopTabOptions.m in Sources */, 26916C991E4B9E7700D13680 /* RNNReactRootViewCreator.m in Sources */, 5064495E20DC62B90026709C /* RNNSideMenuSideOptions.m in Sources */, @@ -2148,6 +2195,7 @@ 30987D71FB4FEEAC8D8978E8 /* DotIndicatorParser.m in Sources */, 50CED44E239EA78700C42EE2 /* TopBarAppearancePresenter.m in Sources */, 30987B23F288EB3A78B7F27C /* RNNDotIndicatorPresenter.m in Sources */, + 5022EDC224053C9F00852BA6 /* TabBarItemAppearanceCreator.m in Sources */, 507ACB1223F44D1E00829911 /* RNNComponentView.m in Sources */, 5017D9F3239D2FCB00B74047 /* BottomTabsOnSwitchToTabAttacher.m in Sources */, 50AD1CE123CB428400FF3134 /* TransitionOptions.m in Sources */, diff --git a/lib/ios/TabBarItemAppearanceCreator.h b/lib/ios/TabBarItemAppearanceCreator.h new file mode 100644 index 00000000000..8efd8493a39 --- /dev/null +++ b/lib/ios/TabBarItemAppearanceCreator.h @@ -0,0 +1,5 @@ +#import "RNNTabBarItemCreator.h" + +@interface TabBarItemAppearanceCreator : RNNTabBarItemCreator + +@end diff --git a/lib/ios/TabBarItemAppearanceCreator.m b/lib/ios/TabBarItemAppearanceCreator.m new file mode 100644 index 00000000000..3a90b42797d --- /dev/null +++ b/lib/ios/TabBarItemAppearanceCreator.m @@ -0,0 +1,13 @@ +#import "TabBarItemAppearanceCreator.h" + +@implementation TabBarItemAppearanceCreator + ++ (void)setTitleAttributes:(UITabBarItem *)tabItem titleAttributes:(NSDictionary *)titleAttributes { + tabItem.standardAppearance.stackedLayoutAppearance.normal.titleTextAttributes = titleAttributes; +} + ++ (void)setSelectedTitleAttributes:(UITabBarItem *)tabItem selectedTitleAttributes:(NSDictionary *)selectedTitleAttributes { + tabItem.standardAppearance.stackedLayoutAppearance.selected.titleTextAttributes = selectedTitleAttributes; +} + +@end diff --git a/lib/ios/UITabBarController+RNNOptions.h b/lib/ios/UITabBarController+RNNOptions.h index f1d09c94fc5..ae899e96f9e 100644 --- a/lib/ios/UITabBarController+RNNOptions.h +++ b/lib/ios/UITabBarController+RNNOptions.h @@ -8,8 +8,6 @@ - (void)setTabBarTestID:(NSString *)testID; -- (void)setTabBarBackgroundColor:(UIColor *)backgroundColor; - - (void)setTabBarStyle:(UIBarStyle)barStyle; - (void)setTabBarTranslucent:(BOOL)translucent; diff --git a/lib/ios/UITabBarController+RNNOptions.m b/lib/ios/UITabBarController+RNNOptions.m index 5af6788d141..819ef85135e 100644 --- a/lib/ios/UITabBarController+RNNOptions.m +++ b/lib/ios/UITabBarController+RNNOptions.m @@ -16,10 +16,6 @@ - (void)setTabBarTestID:(NSString *)testID { self.tabBar.accessibilityIdentifier = testID; } -- (void)setTabBarBackgroundColor:(UIColor *)backgroundColor { - self.tabBar.barTintColor = backgroundColor; -} - - (void)setTabBarStyle:(UIBarStyle)barStyle { self.tabBar.barStyle = barStyle; } diff --git a/playground/ios/NavigationTests/RNNTabBarPresenterTest.m b/playground/ios/NavigationIOS12Tests/RNNBottomTabsPresenterTest.m similarity index 89% rename from playground/ios/NavigationTests/RNNTabBarPresenterTest.m rename to playground/ios/NavigationIOS12Tests/RNNBottomTabsPresenterTest.m index 9fbfddb869b..ac54f29c1e9 100644 --- a/playground/ios/NavigationTests/RNNTabBarPresenterTest.m +++ b/playground/ios/NavigationIOS12Tests/RNNBottomTabsPresenterTest.m @@ -4,7 +4,7 @@ #import "UITabBarController+RNNOptions.h" #import "RNNBottomTabsController.h" -@interface RNNTabBarPresenterTest : XCTestCase +@interface RNNBottomTabsPresenterTest : XCTestCase @property(nonatomic, strong) RNNBottomTabsPresenter *uut; @property(nonatomic, strong) RNNNavigationOptions *options; @@ -12,7 +12,7 @@ @interface RNNTabBarPresenterTest : XCTestCase @end -@implementation RNNTabBarPresenterTest +@implementation RNNBottomTabsPresenterTest - (void)setUp { [super setUp]; @@ -25,7 +25,7 @@ - (void)setUp { - (void)testApplyOptions_shouldSetDefaultEmptyOptions { RNNNavigationOptions *emptyOptions = [[RNNNavigationOptions alloc] initEmptyOptions]; [[self.boundViewController expect] setTabBarTestID:nil]; - [[self.boundViewController expect] setTabBarBackgroundColor:nil]; + [self.uut setTabBarBackgroundColor:nil]; [[self.boundViewController expect] setTabBarTranslucent:NO]; [[self.boundViewController expect] setTabBarHideShadow:NO]; [[self.boundViewController expect] setTabBarStyle:UIBarStyleDefault]; @@ -44,7 +44,7 @@ - (void)testApplyOptions_shouldApplyOptions { initialOptions.bottomTabs.barStyle = [[Text alloc] initWithValue:@"black"]; [[self.boundViewController expect] setTabBarTestID:@"testID"]; - [[self.boundViewController expect] setTabBarBackgroundColor:[UIColor redColor]]; + [self.uut setTabBarBackgroundColor:[UIColor redColor]]; [[self.boundViewController expect] setTabBarTranslucent:NO]; [[self.boundViewController expect] setTabBarHideShadow:YES]; [[self.boundViewController expect] setTabBarStyle:UIBarStyleBlack]; @@ -100,4 +100,11 @@ - (void)testBackgroundColor_validColor { XCTAssertTrue([((UIViewController *)self.boundViewController).view.backgroundColor isEqual:expectedColor]); } +- (void)testTabBarBackgroundColor { + UIColor* tabBarBackgroundColor = [UIColor redColor]; + + [self.uut setTabBarBackgroundColor:tabBarBackgroundColor]; + XCTAssertTrue([((UIViewController *)self.uut).tabBarController.tabBar.barTintColor isEqual:tabBarBackgroundColor]); +} + @end diff --git a/playground/ios/NavigationTests/RNNBasePresenterTest.m b/playground/ios/NavigationTests/RNNBasePresenterTest.m index 08d54966d9a..6a994f6f100 100644 --- a/playground/ios/NavigationTests/RNNBasePresenterTest.m +++ b/playground/ios/NavigationTests/RNNBasePresenterTest.m @@ -17,7 +17,7 @@ @implementation RNNBottomTabPresenterTest - (void)setUp { [super setUp]; - self.uut = [[RNNBasePresenter alloc] init]; + self.uut = [[RNNBasePresenter alloc] initWithDefaultOptions:[[RNNNavigationOptions alloc] initEmptyOptions]]; self.boundViewController = [RNNComponentViewController new]; self.mockBoundViewController = [OCMockObject partialMockForObject:self.boundViewController]; [self.uut bindViewController:self.mockBoundViewController]; diff --git a/playground/ios/NavigationTests/RNNBottomTabsAppearancePresenterTest.m b/playground/ios/NavigationTests/RNNBottomTabsAppearancePresenterTest.m new file mode 100644 index 00000000000..45f0e42b93e --- /dev/null +++ b/playground/ios/NavigationTests/RNNBottomTabsAppearancePresenterTest.m @@ -0,0 +1,114 @@ +#import +#import +#import "BottomTabsAppearancePresenter.h" +#import "UITabBarController+RNNOptions.h" +#import "RNNBottomTabsController.h" +#import "RNNComponentViewController.h" + +@interface RNNBottomTabsAppearancePresenterTest : XCTestCase + +@property(nonatomic, strong) BottomTabsAppearancePresenter *uut; +@property(nonatomic, strong) RNNNavigationOptions *options; +@property(nonatomic, strong) id boundViewController; + +@end + +@implementation RNNBottomTabsAppearancePresenterTest + +- (void)setUp { + [super setUp]; + self.uut = [OCMockObject partialMockForObject:[BottomTabsAppearancePresenter new]]; + self.boundViewController = [OCMockObject partialMockForObject:[RNNBottomTabsController new]]; + [self.uut bindViewController:self.boundViewController]; + self.options = [[RNNNavigationOptions alloc] initEmptyOptions]; +} + +- (void)testApplyOptions_shouldSetDefaultEmptyOptions { + RNNNavigationOptions *emptyOptions = [[RNNNavigationOptions alloc] initEmptyOptions]; + [[self.boundViewController expect] setTabBarTestID:nil]; + [self.uut setTabBarBackgroundColor:nil]; + [[self.boundViewController expect] setTabBarTranslucent:NO]; + [[self.boundViewController expect] setTabBarHideShadow:NO]; + [[self.boundViewController expect] setTabBarStyle:UIBarStyleDefault]; + [[self.boundViewController expect] setTabBarVisible:YES animated:NO]; + [self.uut applyOptions:emptyOptions]; + [self.boundViewController verify]; +} + +- (void)testApplyOptions_shouldApplyOptions { + RNNNavigationOptions *initialOptions = [[RNNNavigationOptions alloc] initEmptyOptions]; + initialOptions.bottomTabs.testID = [[Text alloc] initWithValue:@"testID"]; + initialOptions.bottomTabs.backgroundColor = [[Color alloc] initWithValue:[UIColor redColor]]; + initialOptions.bottomTabs.translucent = [[Bool alloc] initWithValue:@(0)]; + initialOptions.bottomTabs.hideShadow = [[Bool alloc] initWithValue:@(1)]; + initialOptions.bottomTabs.visible = [[Bool alloc] initWithValue:@(0)]; + initialOptions.bottomTabs.barStyle = [[Text alloc] initWithValue:@"black"]; + + [[self.boundViewController expect] setTabBarTestID:@"testID"]; + [self.uut setTabBarBackgroundColor:[UIColor redColor]]; + [[self.boundViewController expect] setTabBarTranslucent:NO]; + [[self.boundViewController expect] setTabBarHideShadow:YES]; + [[self.boundViewController expect] setTabBarStyle:UIBarStyleBlack]; + [[self.boundViewController expect] setTabBarVisible:NO animated:NO]; + + [self.uut applyOptions:initialOptions]; + [self.boundViewController verify]; +} + +- (void)testApplyOptionsOnInit_alwaysShow_shouldNotCenterTabImages { + RNNNavigationOptions *initialOptions = [[RNNNavigationOptions alloc] initEmptyOptions]; + initialOptions.bottomTabs.titleDisplayMode = [[Text alloc] initWithValue:@"alwaysShow"]; + [[self.boundViewController reject] centerTabItems]; + [self.uut applyOptionsOnInit:initialOptions]; + [self.boundViewController verify]; +} + +- (void)testApplyOptions_shouldApplyOptionsOnInit_alwaysHide_shouldCenterTabImages { + RNNNavigationOptions *initialOptions = [[RNNNavigationOptions alloc] initEmptyOptions]; + initialOptions.bottomTabs.titleDisplayMode = [[Text alloc] initWithValue:@"alwaysHide"]; + [[self.boundViewController expect] centerTabItems]; + [self.uut applyOptionsOnInit:initialOptions]; + [self.boundViewController verify]; +} + +- (void)testViewDidLayoutSubviews_appliesBadgeOnNextRunLoop { + id uut = [self uut]; + [[uut expect] applyDotIndicator]; + [uut viewDidLayoutSubviews]; + [[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]]; + [uut verify]; +} + +- (void)testApplyDotIndicator_callsAppliesBadgeWithEachChild { + id uut = [self uut]; + id child1 = [UIViewController new]; + id child2 = [UIViewController new]; + + [[uut expect] applyDotIndicator:child1]; + [[uut expect] applyDotIndicator:child2]; + [[self boundViewController] addChildViewController:child1]; + [[self boundViewController] addChildViewController:child2]; + + [uut applyDotIndicator]; + [uut verify]; +} + +- (void)testBackgroundColor_validColor { + UIColor* inputColor = [RCTConvert UIColor:@(0xFFFF0000)]; + self.options.layout.backgroundColor = [[Color alloc] initWithValue:inputColor]; + [self.uut applyOptions:self.options]; + UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1]; + XCTAssertTrue([((UIViewController *)self.boundViewController).view.backgroundColor isEqual:expectedColor]); +} + +- (void)testTabBarBackgroundColor { + UIColor* tabBarBackgroundColor = [UIColor redColor]; + RNNComponentPresenter* vcPresenter = [[RNNComponentPresenter alloc] initWithDefaultOptions:nil]; + UIViewController* vc = [[RNNComponentViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:vcPresenter options:nil defaultOptions:nil]; + + [((UITabBarController *)self.boundViewController) setViewControllers:@[vc]]; + [self.uut setTabBarBackgroundColor:tabBarBackgroundColor]; + XCTAssertTrue([vc.tabBarItem.standardAppearance.backgroundColor isEqual:tabBarBackgroundColor]); +} + +@end diff --git a/playground/ios/NavigationTests/RNNDotIndicatorPresenterTest.m b/playground/ios/NavigationTests/RNNDotIndicatorPresenterTest.m index a9deed8788a..190363a72b5 100644 --- a/playground/ios/NavigationTests/RNNDotIndicatorPresenterTest.m +++ b/playground/ios/NavigationTests/RNNDotIndicatorPresenterTest.m @@ -145,7 +145,7 @@ - (RNNComponentViewController *)createChild { id img = [OCMockObject partialMockForObject:[UIImage new]]; options.bottomTab.icon = [[Image alloc] initWithValue:img]; - return [[RNNComponentViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[RNNComponentPresenter new] options:options defaultOptions:nil]; + return [[RNNComponentViewController alloc] initWithLayoutInfo:nil rootViewCreator:nil eventEmitter:nil presenter:[[RNNComponentPresenter alloc] initWithDefaultOptions:[[RNNNavigationOptions alloc] initEmptyOptions]] options:options defaultOptions:nil]; } - (BOOL)tabHasIndicator { diff --git a/playground/ios/NavigationTests/UITabBarController+RNNOptionsTest.m b/playground/ios/NavigationTests/UITabBarController+RNNOptionsTest.m index 35fdef02af9..620226619df 100644 --- a/playground/ios/NavigationTests/UITabBarController+RNNOptionsTest.m +++ b/playground/ios/NavigationTests/UITabBarController+RNNOptionsTest.m @@ -17,6 +17,12 @@ - (void)setUp { OCMStub([self.uut tabBar]).andReturn([OCMockObject partialMockForObject:[UITabBar new]]); } +- (void)test_centerTabItems { + [[(id)self.uut.tabBar expect] centerTabItems]; + [self.uut centerTabItems]; + [(id)self.uut.tabBar verify]; +} + - (void)test_tabBarTranslucent_true { [self.uut setTabBarTranslucent:YES]; XCTAssertTrue(self.uut.tabBar.translucent); @@ -41,17 +47,4 @@ - (void)test_tabBarHideShadow_false { XCTAssertFalse(self.uut.tabBar.clipsToBounds); } -- (void)test_centerTabItems { - [[(id)self.uut.tabBar expect] centerTabItems]; - [self.uut centerTabItems]; - [(id)self.uut.tabBar verify]; -} - -- (void)test_tabBarBackgroundColor { - UIColor* tabBarBackgroundColor = [UIColor redColor]; - - [self.uut setTabBarBackgroundColor:tabBarBackgroundColor]; - XCTAssertTrue([self.uut.tabBar.barTintColor isEqual:tabBarBackgroundColor]); -} - @end diff --git a/playground/ios/playground.xcodeproj/project.pbxproj b/playground/ios/playground.xcodeproj/project.pbxproj index dbabf73119d..2e87bb296e8 100644 --- a/playground/ios/playground.xcodeproj/project.pbxproj +++ b/playground/ios/playground.xcodeproj/project.pbxproj @@ -12,6 +12,8 @@ 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 501C86B9239FE9C400E0B631 /* UIImage+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 501C86B8239FE9C400E0B631 /* UIImage+Utils.m */; }; + 5022EDCD2405522000852BA6 /* RNNBottomTabsPresenterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D263A2385888C003F36BA /* RNNBottomTabsPresenterTest.m */; }; + 5022EDCE2405524700852BA6 /* RNNBottomTabsAppearancePresenterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5022EDCB240551EE00852BA6 /* RNNBottomTabsAppearancePresenterTest.m */; }; 50451D35204451A900695F00 /* RNNCustomViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50451D34204451A800695F00 /* RNNCustomViewController.m */; }; 50647FE323E3196800B92025 /* RNNExternalViewControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 50647FE223E3196800B92025 /* RNNExternalViewControllerTests.m */; }; 50996C6823AA477400008F89 /* RNNRootViewControllerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 50996C6723AA477400008F89 /* RNNRootViewControllerTest.m */; }; @@ -36,7 +38,6 @@ E58D26532385888C003F36BA /* RNNSideMenuPresenterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D26362385888B003F36BA /* RNNSideMenuPresenterTest.m */; }; E58D26542385888C003F36BA /* RNNSideMenuControllerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D26372385888B003F36BA /* RNNSideMenuControllerTest.m */; }; E58D26552385888C003F36BA /* RNNTransitionStateHolderTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D26382385888B003F36BA /* RNNTransitionStateHolderTest.m */; }; - E58D26572385888C003F36BA /* RNNTabBarPresenterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D263A2385888C003F36BA /* RNNTabBarPresenterTest.m */; }; E58D26582385888C003F36BA /* UITabBarController+RNNOptionsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D263B2385888C003F36BA /* UITabBarController+RNNOptionsTest.m */; }; E58D26592385888C003F36BA /* RNNNavigationStackManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D263C2385888C003F36BA /* RNNNavigationStackManagerTest.m */; }; E58D265A2385888C003F36BA /* RNNTestRootViewCreator.m in Sources */ = {isa = PBXBuildFile; fileRef = E58D263D2385888C003F36BA /* RNNTestRootViewCreator.m */; }; @@ -81,6 +82,7 @@ 4AE37ACF6BFBAB211EE8E7E9 /* Pods-NavigationIOS12Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NavigationIOS12Tests.release.xcconfig"; path = "Target Support Files/Pods-NavigationIOS12Tests/Pods-NavigationIOS12Tests.release.xcconfig"; sourceTree = ""; }; 501C86B7239FE9C400E0B631 /* UIImage+Utils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+Utils.h"; sourceTree = ""; }; 501C86B8239FE9C400E0B631 /* UIImage+Utils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Utils.m"; sourceTree = ""; }; + 5022EDCB240551EE00852BA6 /* RNNBottomTabsAppearancePresenterTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNBottomTabsAppearancePresenterTest.m; sourceTree = ""; }; 50364D69238E7ECC000E62A2 /* Pods_playground.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_playground.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50364D6B238E7F0A000E62A2 /* ReactNativeNavigation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ReactNativeNavigation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50451D33204451A800695F00 /* RNNCustomViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNNCustomViewController.h; path = ../../../lib/ios/RNNCustomViewController.h; sourceTree = ""; }; @@ -118,7 +120,7 @@ E58D26362385888B003F36BA /* RNNSideMenuPresenterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuPresenterTest.m; sourceTree = ""; }; E58D26372385888B003F36BA /* RNNSideMenuControllerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuControllerTest.m; sourceTree = ""; }; E58D26382385888B003F36BA /* RNNTransitionStateHolderTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNTransitionStateHolderTest.m; sourceTree = ""; }; - E58D263A2385888C003F36BA /* RNNTabBarPresenterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNTabBarPresenterTest.m; sourceTree = ""; }; + E58D263A2385888C003F36BA /* RNNBottomTabsPresenterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNBottomTabsPresenterTest.m; sourceTree = ""; }; E58D263B2385888C003F36BA /* UITabBarController+RNNOptionsTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITabBarController+RNNOptionsTest.m"; sourceTree = ""; }; E58D263C2385888C003F36BA /* RNNNavigationStackManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNNavigationStackManagerTest.m; sourceTree = ""; }; E58D263D2385888C003F36BA /* RNNTestRootViewCreator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNTestRootViewCreator.m; sourceTree = ""; }; @@ -192,6 +194,7 @@ 50996C5E23AA46DD00008F89 /* NavigationIOS12Tests */ = { isa = PBXGroup; children = ( + E58D263A2385888C003F36BA /* RNNBottomTabsPresenterTest.m */, 50996C6723AA477400008F89 /* RNNRootViewControllerTest.m */, 50996C6123AA46DD00008F89 /* Info.plist */, ); @@ -269,7 +272,7 @@ E58D26362385888B003F36BA /* RNNSideMenuPresenterTest.m */, E58D26312385888B003F36BA /* RNNStackPresenterTest.m */, E58D26292385888B003F36BA /* RNNTabBarControllerTest.m */, - E58D263A2385888C003F36BA /* RNNTabBarPresenterTest.m */, + 5022EDCB240551EE00852BA6 /* RNNBottomTabsAppearancePresenterTest.m */, E58D26342385888B003F36BA /* RNNTestRootViewCreator.h */, E58D263D2385888C003F36BA /* RNNTestRootViewCreator.m */, E58D26382385888B003F36BA /* RNNTransitionStateHolderTest.m */, @@ -731,6 +734,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 5022EDCD2405522000852BA6 /* RNNBottomTabsPresenterTest.m in Sources */, 50996C6923AA487800008F89 /* RNNTestRootViewCreator.m in Sources */, 50996C6823AA477400008F89 /* RNNRootViewControllerTest.m in Sources */, ); @@ -762,12 +766,12 @@ E58D26602385888C003F36BA /* RNNModalManagerTest.m in Sources */, E58D26502385888C003F36BA /* RNNNavigationOptionsTest.m in Sources */, E58D264E2385888C003F36BA /* RNNTestBase.m in Sources */, + 5022EDCE2405524700852BA6 /* RNNBottomTabsAppearancePresenterTest.m in Sources */, E58D26612385888C003F36BA /* RNNTestNoColor.m in Sources */, E58D265D2385888C003F36BA /* RNNControllerFactoryTest.m in Sources */, E58D265C2385888C003F36BA /* RNNStackControllerTest.m in Sources */, E58D26482385888C003F36BA /* RNNDotIndicatorPresenterTest.m in Sources */, E58D26522385888C003F36BA /* RNNComponentPresenterTest.m in Sources */, - E58D26572385888C003F36BA /* RNNTabBarPresenterTest.m in Sources */, E58D264C2385888C003F36BA /* RNNSideMenuParserTest.m in Sources */, E58D264F2385888C003F36BA /* RNNStackPresenterTest.m in Sources */, );