Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix user interface style in native stack view controllers #481

Merged
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
6 changes: 6 additions & 0 deletions ios/RNSScreenStack.m
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ - (void)setModalViewControllers:(NSArray<UIViewController *> *)controllers
for (NSUInteger i = changeRootIndex; i < controllers.count; i++) {
UIViewController *next = controllers[i];
BOOL lastModal = (i == controllers.count - 1);

if (@available(iOS 13.0, *)) {
Copy link
Member

Choose a reason for hiding this comment

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

This also does not matter I think as soon appstore will stop accepting builds made with prev versions of xcode (if that isn't the case already) but for consistency can we add #ifdef __IPHONE_13_0 to wrap this call much like we do in other cases where we do version checks

// Inherit UI style from its parent - solves an issue with incorrect style being applied to some UIKit views like date picker or segmented control.
next.overrideUserInterfaceStyle = previous.overrideUserInterfaceStyle;
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this should make any difference in your case but I think it'd be more intuitive if presented controllers would inherit styles from their container and not from the sibling modal. If so I'd copy the property from _controller.overrideUserInterfaceStyle here and not from previous

}

[previous presentViewController:next
animated:lastModal
completion:^{
Expand Down