Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 102b718
Author: Sergei Butko <svbutko@hotmail.com>
Date:   Thu Sep 30 12:59:05 2021 +0300

    Add callback as optional parameter to updateProps (#7277)

    * Add callback as optional parameter to updateProps

    * Add optional callback to NavigationDelegate

    * Add tests to Store and ComponentWrapper

    Co-authored-by: Ward Abbass <warda@wix.com>

commit 92bbcc1
Author: Jordan Becker <jordanbeckerfr@gmail.com>
Date:   Thu Sep 30 10:32:22 2021 +0200

    Fix iOS 15 bars appearance (#7270)

    Following #7266 and especially [my comment there](#7266 (comment)), I'm opening this PR to provide a quick fix to people experiencing issues when building RNN using Xcode 13.

    This should be considered a fix PR rather than a feature PR, as what it's doing is basically duplicating the already set `standardAppearance` to a `scrollEdgeAppearance`. What this means is that the bars will have the same visual aspect whether they're displayed alongside the edge of a scroll view.

    In a future, more elaborate PR, we could imagine a way to be able to provide `scrollEdgeAppearance` values from JS for more control over the native bars.

    Fixes #7266
    Fixes #7268

    Co-authored-by: Yogev Ben David <yogev132@gmail.com>

commit f87e1ca
Author: Sergei Butko <svbutko@hotmail.com>
Date:   Thu Sep 30 01:06:36 2021 +0300

    Remove default splash layout color on Android (#7276)

    Co-authored-by: Ward Abbass <warda@wix.com>

commit a207f62
Author: Tom Spencer <tom.spencer@studiozeffa.com>
Date:   Wed Sep 29 15:44:15 2021 +0100

    Fix sideMenu docs (#7275)

    Updated the example using `Navigation.mergeOptions` to open the side menu with the correct first argument.
  • Loading branch information
swabbass committed Oct 3, 2021
1 parent a013e28 commit 728b69c
Show file tree
Hide file tree
Showing 26 changed files with 202 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class NavigationActivity extends AppCompatActivity implements DefaultHardwareBackBtnHandler, PermissionAwareActivity, JsDevReloadHandler.ReloadListener {
@Nullable
private PermissionListener mPermissionListener;

protected Navigator navigator;

@Override
Expand Down Expand Up @@ -146,7 +146,6 @@ public void onReload() {

protected void addDefaultSplashLayout() {
View view = new View(this);
view.setBackgroundColor(Color.WHITE);
setContentView(view);
}

Expand Down
6 changes: 0 additions & 6 deletions lib/ios/BottomTabAppearancePresenter.h

This file was deleted.

12 changes: 0 additions & 12 deletions lib/ios/BottomTabAppearancePresenter.m

This file was deleted.

5 changes: 4 additions & 1 deletion lib/ios/BottomTabPresenter.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#import "RNNBasePresenter.h"

#import "RNNTabBarItemCreator.h"
@interface BottomTabPresenter : RNNBasePresenter

- (instancetype)initWithDefaultOptions:(RNNNavigationOptions *)defaultOptions
tabCreator:(RNNTabBarItemCreator *)tabCreator;

- (void)applyOptions:(RNNNavigationOptions *)options child:(UIViewController *)child;

- (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options
Expand Down
14 changes: 11 additions & 3 deletions lib/ios/BottomTabPresenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
#import "UIViewController+LayoutProtocol.h"
#import "UIViewController+RNNOptions.h"

@implementation BottomTabPresenter
@implementation BottomTabPresenter {
RNNTabBarItemCreator *_tabCreator;
}

- (instancetype)initWithDefaultOptions:(RNNNavigationOptions *)defaultOptions
tabCreator:(RNNTabBarItemCreator *)tabCreator {
self = [super initWithDefaultOptions:defaultOptions];
_tabCreator = tabCreator;
return self;
}

- (void)applyOptions:(RNNNavigationOptions *)options child:(UIViewController *)child {
RNNNavigationOptions *withDefault = [options withDefault:self.defaultOptions];
Expand Down Expand Up @@ -37,8 +46,7 @@ - (void)mergeOptions:(RNNNavigationOptions *)mergeOptions

- (void)createTabBarItem:(UIViewController *)child
bottomTabOptions:(RNNBottomTabOptions *)bottomTabOptions {
child.tabBarItem = [RNNTabBarItemCreator createTabBarItem:bottomTabOptions
mergeItem:child.tabBarItem];
child.tabBarItem = [_tabCreator createTabBarItem:bottomTabOptions mergeItem:child.tabBarItem];
}

@end
15 changes: 11 additions & 4 deletions lib/ios/BottomTabPresenterCreator.m
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
#import "BottomTabPresenterCreator.h"
#import "BottomTabAppearancePresenter.h"
#import "RNNTabBarItemCreator.h"
#import "TabBarItemAppearanceCreator.h"
#import "TabBarItemIOS15Creator.h"

@implementation BottomTabPresenterCreator

+ (BottomTabPresenter *)createWithDefaultOptions:(RNNNavigationOptions *)defaultOptions {
if (@available(iOS 13.0, *)) {
return [[BottomTabAppearancePresenter alloc] initWithDefaultOptions:defaultOptions];
RNNTabBarItemCreator *tabCreator;
if (@available(iOS 15.0, *)) {
tabCreator = [TabBarItemIOS15Creator new];
} else if (@available(iOS 13.0, *)) {
tabCreator = [TabBarItemAppearanceCreator new];
} else {
return [[BottomTabPresenter alloc] initWithDefaultOptions:defaultOptions];
tabCreator = [RNNTabBarItemCreator new];
}

return [[BottomTabPresenter alloc] initWithDefaultOptions:defaultOptions tabCreator:tabCreator];
}

@end
33 changes: 29 additions & 4 deletions lib/ios/BottomTabsAppearancePresenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ - (void)applyTabBarBorder:(RNNBottomTabsOptions *)options {

- (void)setTabBarBackgroundColor:(UIColor *)backgroundColor {
[self setTabBarOpaqueBackground];
for (UIViewController *childViewController in self.tabBarController.childViewControllers)
for (UIViewController *childViewController in self.tabBarController.childViewControllers) {
childViewController.tabBarItem.standardAppearance.backgroundColor = backgroundColor;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
if (@available(iOS 15.0, *)) {
childViewController.tabBarItem.scrollEdgeAppearance.backgroundColor = backgroundColor;
}
#endif
}
}

- (void)setTabBarTranslucent:(BOOL)translucent {
Expand All @@ -46,18 +52,37 @@ - (void)setTabBarDefaultBackground {
}

- (void)setTabBarTranslucentBackground {
for (UIViewController *childViewController in self.tabBarController.childViewControllers)
for (UIViewController *childViewController in self.tabBarController.childViewControllers) {
[childViewController.tabBarItem.standardAppearance configureWithDefaultBackground];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
if (@available(iOS 15.0, *)) {
[childViewController.tabBarItem.scrollEdgeAppearance configureWithDefaultBackground];
}
#endif
}
}

- (void)setTabBarTransparentBackground {
for (UIViewController *childViewController in self.tabBarController.childViewControllers)
for (UIViewController *childViewController in self.tabBarController.childViewControllers) {
[childViewController.tabBarItem.standardAppearance configureWithTransparentBackground];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
if (@available(iOS 15.0, *)) {
[childViewController.tabBarItem
.scrollEdgeAppearance configureWithTransparentBackground];
}
#endif
}
}

- (void)setTabBarOpaqueBackground {
for (UIViewController *childViewController in self.tabBarController.childViewControllers)
for (UIViewController *childViewController in self.tabBarController.childViewControllers) {
[childViewController.tabBarItem.standardAppearance configureWithOpaqueBackground];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
if (@available(iOS 15.0, *)) {
[childViewController.tabBarItem.scrollEdgeAppearance configureWithOpaqueBackground];
}
#endif
}
}

@end
5 changes: 5 additions & 0 deletions lib/ios/RNNBottomTabsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ - (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo
if (@available(iOS 13.0, *)) {
self.tabBar.standardAppearance = [UITabBarAppearance new];
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
if (@available(iOS 15.0, *)) {
self.tabBar.scrollEdgeAppearance = [UITabBarAppearance new];
}
#endif

self.longPressRecognizer =
[[UILongPressGestureRecognizer alloc] initWithTarget:self
Expand Down
8 changes: 4 additions & 4 deletions lib/ios/RNNTabBarItemCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

@interface RNNTabBarItemCreator : NSObject

+ (UITabBarItem *)createTabBarItem:(RNNBottomTabOptions *)bottomTabOptions
- (UITabBarItem *)createTabBarItem:(RNNBottomTabOptions *)bottomTabOptions
mergeItem:(UITabBarItem *)mergeItem;

+ (UITabBarItem *)createTabBarItem:(UITabBarItem *)mergeItem;
- (UITabBarItem *)createTabBarItem:(UITabBarItem *)mergeItem;

+ (void)setTitleAttributes:(UITabBarItem *)tabItem titleAttributes:(NSDictionary *)titleAttributes;
- (void)setTitleAttributes:(UITabBarItem *)tabItem titleAttributes:(NSDictionary *)titleAttributes;

+ (void)setSelectedTitleAttributes:(UITabBarItem *)tabItem
- (void)setSelectedTitleAttributes:(UITabBarItem *)tabItem
selectedTitleAttributes:(NSDictionary *)selectedTitleAttributes;

@end
14 changes: 7 additions & 7 deletions lib/ios/RNNTabBarItemCreator.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

@implementation RNNTabBarItemCreator

+ (UITabBarItem *)createTabBarItem:(UITabBarItem *)mergeItem {
- (UITabBarItem *)createTabBarItem:(UITabBarItem *)mergeItem {
return [UITabBarItem new];
}

+ (UITabBarItem *)createTabBarItem:(RNNBottomTabOptions *)bottomTabOptions
- (UITabBarItem *)createTabBarItem:(RNNBottomTabOptions *)bottomTabOptions
mergeItem:(UITabBarItem *)mergeItem {
UITabBarItem *tabItem = [self createTabBarItem:mergeItem];
UIImage *icon = [bottomTabOptions.icon withDefault:nil];
Expand Down Expand Up @@ -44,7 +44,7 @@ + (UITabBarItem *)createTabBarItem:(RNNBottomTabOptions *)bottomTabOptions
return tabItem;
}

+ (UIImage *)getSelectedIconImage:(UIImage *)selectedIcon
- (UIImage *)getSelectedIconImage:(UIImage *)selectedIcon
selectedIconColor:(UIColor *)selectedIconColor {
if (selectedIcon) {
if (selectedIconColor) {
Expand All @@ -58,7 +58,7 @@ + (UIImage *)getSelectedIconImage:(UIImage *)selectedIcon
return nil;
}

+ (UIImage *)getIconImage:(UIImage *)icon withTint:(UIColor *)tintColor {
- (UIImage *)getIconImage:(UIImage *)icon withTint:(UIColor *)tintColor {
if (icon) {
if (tintColor) {
return [[icon withTintColor:tintColor]
Expand All @@ -71,7 +71,7 @@ + (UIImage *)getIconImage:(UIImage *)icon withTint:(UIColor *)tintColor {
return nil;
}

+ (void)appendTitleAttributes:(UITabBarItem *)tabItem
- (void)appendTitleAttributes:(UITabBarItem *)tabItem
bottomTabOptions:(RNNBottomTabOptions *)bottomTabOptions {
UIColor *textColor = [bottomTabOptions.textColor withDefault:[UIColor blackColor]];
UIColor *selectedTextColor =
Expand All @@ -97,11 +97,11 @@ + (void)appendTitleAttributes:(UITabBarItem *)tabItem
[self setTitleAttributes:tabItem titleAttributes:normalAttributes];
}

+ (void)setTitleAttributes:(UITabBarItem *)tabItem titleAttributes:(NSDictionary *)titleAttributes {
- (void)setTitleAttributes:(UITabBarItem *)tabItem titleAttributes:(NSDictionary *)titleAttributes {
[tabItem setTitleTextAttributes:titleAttributes forState:UIControlStateNormal];
}

+ (void)setSelectedTitleAttributes:(UITabBarItem *)tabItem
- (void)setSelectedTitleAttributes:(UITabBarItem *)tabItem
selectedTitleAttributes:(NSDictionary *)selectedTitleAttributes {
[tabItem setTitleTextAttributes:selectedTitleAttributes forState:UIControlStateSelected];
}
Expand Down
16 changes: 8 additions & 8 deletions lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@
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 */; };
Expand Down Expand Up @@ -375,6 +373,8 @@
50E5F792223FA04C002AFEAD /* TransitionDetailsOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E5F790223FA04C002AFEAD /* TransitionDetailsOptions.m */; };
50E5F7952240EBD6002AFEAD /* RNNAnimationsTransitionDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 50E5F7932240EBD6002AFEAD /* RNNAnimationsTransitionDelegate.h */; };
50E5F7962240EBD6002AFEAD /* RNNAnimationsTransitionDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E5F7942240EBD6002AFEAD /* RNNAnimationsTransitionDelegate.m */; };
50E99C422704A7170006D4D1 /* TabBarItemIOS15Creator.h in Headers */ = {isa = PBXBuildFile; fileRef = 50E99C402704A7170006D4D1 /* TabBarItemIOS15Creator.h */; };
50E99C432704A7170006D4D1 /* TabBarItemIOS15Creator.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E99C412704A7170006D4D1 /* TabBarItemIOS15Creator.m */; };
50EA541623AEDF5D006F881A /* RNNInterpolator.h in Headers */ = {isa = PBXBuildFile; fileRef = 50EA541423AEDF5D006F881A /* RNNInterpolator.h */; };
50EA541723AEDF5D006F881A /* RNNInterpolator.m in Sources */ = {isa = PBXBuildFile; fileRef = 50EA541523AEDF5D006F881A /* RNNInterpolator.m */; };
50EA541A23AEE1C6006F881A /* AnimatedReactView.h in Headers */ = {isa = PBXBuildFile; fileRef = 50EA541823AEE1C6006F881A /* AnimatedReactView.h */; };
Expand Down Expand Up @@ -624,8 +624,6 @@
50206A6C21AFE75400B7BB1A /* RNNSideMenuParserTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuParserTest.m; sourceTree = "<group>"; };
5022EDB32405224B00852BA6 /* BottomTabPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BottomTabPresenter.h; sourceTree = "<group>"; };
5022EDB42405224B00852BA6 /* BottomTabPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BottomTabPresenter.m; sourceTree = "<group>"; };
5022EDB72405226800852BA6 /* BottomTabAppearancePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BottomTabAppearancePresenter.h; sourceTree = "<group>"; };
5022EDB82405226800852BA6 /* BottomTabAppearancePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BottomTabAppearancePresenter.m; sourceTree = "<group>"; };
5022EDBB2405237100852BA6 /* BottomTabPresenterCreator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BottomTabPresenterCreator.h; sourceTree = "<group>"; };
5022EDBC2405237100852BA6 /* BottomTabPresenterCreator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BottomTabPresenterCreator.m; sourceTree = "<group>"; };
5022EDBF24053C9F00852BA6 /* TabBarItemAppearanceCreator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TabBarItemAppearanceCreator.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -908,6 +906,8 @@
50E5F790223FA04C002AFEAD /* TransitionDetailsOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TransitionDetailsOptions.m; sourceTree = "<group>"; };
50E5F7932240EBD6002AFEAD /* RNNAnimationsTransitionDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNAnimationsTransitionDelegate.h; sourceTree = "<group>"; };
50E5F7942240EBD6002AFEAD /* RNNAnimationsTransitionDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNAnimationsTransitionDelegate.m; sourceTree = "<group>"; };
50E99C402704A7170006D4D1 /* TabBarItemIOS15Creator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TabBarItemIOS15Creator.h; sourceTree = "<group>"; };
50E99C412704A7170006D4D1 /* TabBarItemIOS15Creator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TabBarItemIOS15Creator.m; sourceTree = "<group>"; };
50EA541423AEDF5D006F881A /* RNNInterpolator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNInterpolator.h; sourceTree = "<group>"; };
50EA541523AEDF5D006F881A /* RNNInterpolator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNInterpolator.m; sourceTree = "<group>"; };
50EA541823AEE1C6006F881A /* AnimatedReactView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnimatedReactView.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1118,6 +1118,8 @@
5038A3BC216E1490009280BC /* RNNTabBarItemCreator.m */,
5022EDBF24053C9F00852BA6 /* TabBarItemAppearanceCreator.h */,
5022EDC024053C9F00852BA6 /* TabBarItemAppearanceCreator.m */,
50E99C402704A7170006D4D1 /* TabBarItemIOS15Creator.h */,
50E99C412704A7170006D4D1 /* TabBarItemIOS15Creator.m */,
5053CE7D2175FB1900D0386B /* RNNDefaultOptionsHelper.h */,
5053CE7E2175FB1900D0386B /* RNNDefaultOptionsHelper.m */,
C2A57A1A21E815F80066711C /* InteractivePopGestureDelegate.h */,
Expand Down Expand Up @@ -1509,8 +1511,6 @@
505C640123E074860078AFC0 /* TopBarTitlePresenter.m */,
5022EDB32405224B00852BA6 /* BottomTabPresenter.h */,
5022EDB42405224B00852BA6 /* BottomTabPresenter.m */,
5022EDB72405226800852BA6 /* BottomTabAppearancePresenter.h */,
5022EDB82405226800852BA6 /* BottomTabAppearancePresenter.m */,
5022EDC324054C6100852BA6 /* BottomTabsAppearancePresenter.h */,
5022EDC424054C6100852BA6 /* BottomTabsAppearancePresenter.m */,
5041DC3C2417BBBA0033312F /* BottomTabsBasePresenter.h */,
Expand Down Expand Up @@ -1892,7 +1892,6 @@
507ACB1123F44D1E00829911 /* RNNComponentView.h in Headers */,
B84F6E50252C5ECE007D78A1 /* DecelerateInterpolator.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 */,
Expand Down Expand Up @@ -1987,6 +1986,7 @@
50CED449239EA56100C42EE2 /* TopBarPresenterCreator.h in Headers */,
5012240E21735999000F5F98 /* RNNBasePresenter.h in Headers */,
50495952216F62BD006D2B81 /* NullNumber.h in Headers */,
50E99C422704A7170006D4D1 /* TabBarItemIOS15Creator.h in Headers */,
5012242221736883000F5F98 /* NullColor.h in Headers */,
50CED451239F9DFC00C42EE2 /* TopBarPresenter.h in Headers */,
B8415321251E088100467F37 /* LinearInterpolator.h in Headers */,
Expand Down Expand Up @@ -2225,6 +2225,7 @@
50D3A36F23B8D6C600717F95 /* SharedElementAnimator.m in Sources */,
5012242721737278000F5F98 /* NullImage.m in Sources */,
5022EDC624054C6100852BA6 /* BottomTabsAppearancePresenter.m in Sources */,
50E99C432704A7170006D4D1 /* TabBarItemIOS15Creator.m in Sources */,
7B1126A01E2D263F00F9B03B /* RNNEventEmitter.m in Sources */,
504189582506144D004A6BC7 /* RNNSetRootAnimator.m in Sources */,
A7626BFD1FC2FB2C00492FB8 /* RNNTopBarOptions.m in Sources */,
Expand All @@ -2242,7 +2243,6 @@
390AD478200F499D00A8250D /* RNNSwizzles.m in Sources */,
50E02BD921A6EE0F00A43942 /* SideMenuOpenMode.m in Sources */,
503A8A0E23BC9BC50094D1C4 /* ElementVerticalTransition.m in Sources */,
5022EDBA2405226800852BA6 /* BottomTabAppearancePresenter.m in Sources */,
7BA500751E2544B9001B9E1B /* ReactNativeNavigation.m in Sources */,
50E5F7962240EBD6002AFEAD /* RNNAnimationsTransitionDelegate.m in Sources */,
5038A3BA216DFCFD009280BC /* UITabBarController+RNNOptions.m in Sources */,
Expand Down
6 changes: 3 additions & 3 deletions lib/ios/TabBarItemAppearanceCreator.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

@implementation TabBarItemAppearanceCreator

+ (UITabBarItem *)createTabBarItem:(UITabBarItem *)mergeItem {
- (UITabBarItem *)createTabBarItem:(UITabBarItem *)mergeItem {
UITabBarItem *tabBarItem = [super createTabBarItem:mergeItem];
tabBarItem.standardAppearance =
mergeItem.standardAppearance ?: [[UITabBarAppearance alloc] init];
return tabBarItem;
}

+ (void)setTitleAttributes:(UITabBarItem *)tabItem titleAttributes:(NSDictionary *)titleAttributes {
- (void)setTitleAttributes:(UITabBarItem *)tabItem titleAttributes:(NSDictionary *)titleAttributes {
tabItem.standardAppearance.stackedLayoutAppearance.normal.titleTextAttributes = titleAttributes;
tabItem.standardAppearance.compactInlineLayoutAppearance.normal.titleTextAttributes =
titleAttributes;
tabItem.standardAppearance.inlineLayoutAppearance.normal.titleTextAttributes = titleAttributes;
}

+ (void)setSelectedTitleAttributes:(UITabBarItem *)tabItem
- (void)setSelectedTitleAttributes:(UITabBarItem *)tabItem
selectedTitleAttributes:(NSDictionary *)selectedTitleAttributes {
tabItem.standardAppearance.stackedLayoutAppearance.selected.titleTextAttributes =
selectedTitleAttributes;
Expand Down
6 changes: 6 additions & 0 deletions lib/ios/TabBarItemIOS15Creator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#import "TabBarItemAppearanceCreator.h"

API_AVAILABLE(ios(15.0))
@interface TabBarItemIOS15Creator : TabBarItemAppearanceCreator

@end
Loading

0 comments on commit 728b69c

Please sign in to comment.