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

refactor(iOS): simplify UINavigationControllerDelegate methods implementation #2562

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
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/RNSScreenStack.mm
Original file line number Diff line number Diff line change
Expand Up @@ -244,21 +244,16 @@ - (void)navigationController:(UINavigationController *)navigationController
willShowViewController:(UIViewController *)viewController
animated:(BOOL)animated
{
UIView *view = viewController.view;
#ifdef RCT_NEW_ARCH_ENABLED
if (![view isKindOfClass:[RNSScreenView class]]) {
if (![viewController.view isKindOfClass:[RNSScreenView class]]) {
// if the current view is a snapshot, config was already removed so we don't trigger the method
return;
}
#endif
RNSScreenStackHeaderConfig *config = nil;
for (UIView *subview in view.reactSubviews) {
if ([subview isKindOfClass:[RNSScreenStackHeaderConfig class]]) {
config = (RNSScreenStackHeaderConfig *)subview;
break;
}
}
[RNSScreenStackHeaderConfig willShowViewController:viewController animated:animated withConfig:config];
auto *screenView = static_cast<RNSScreenView *>(viewController.view);
[RNSScreenStackHeaderConfig willShowViewController:viewController
animated:animated
withConfig:screenView.findHeaderConfig];
}

- (void)presentationControllerDidDismiss:(UIPresentationController *)presentationController
Expand Down
Loading