Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions ios/RNSScreenStackHeaderConfig.mm
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,9 @@ + (void)updateViewController:(UIViewController *)vc

auto shouldUseCustomBackBarButtonItem = !isBackTitleBlank || config.disableBackButtonMenu;

#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_14_0) && \
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0
if (@available(iOS 14.0, *)) {
prevItem.backButtonDisplayMode = config.backButtonDisplayMode;
}
#endif
// This has any effect only in case the `backBarButtonItem` is not set.
// We apply it before we configure the back item, because it might get overriden.
prevItem.backButtonDisplayMode = config.backButtonDisplayMode;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to wrap it inside ifdefs due to #2799 (min supported iOS version is 15.1 now


if (config.isBackTitleVisible) {
if ((config.backTitleFontFamily &&
Expand Down Expand Up @@ -666,11 +663,9 @@ + (void)updateViewController:(UIViewController *)vc
// back button title should be not visible next to back button,
// but it should still appear in back menu (if one is enabled)

// When backBarButtonItem's title is null, back menu will use value
// of backButtonTitle
[backBarButtonItem setTitle:nil];
shouldUseCustomBackBarButtonItem = YES;
prevItem.backButtonTitle = resolvedBackTitle;
prevItem.backButtonDisplayMode = UINavigationItemBackButtonDisplayModeMinimal;
shouldUseCustomBackBarButtonItem = NO;
}

// Prevent unnecessary assignment of backBarButtonItem if it is not customized,
Expand Down
Loading