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

[Feature Request] Initialize window.rootViewController as a UINavigationController #142

Closed
JonatanSalas opened this issue Jun 21, 2020 · 2 comments

Comments

@JonatanSalas
Copy link

Feature request

Making window.rootViewController be initialized as a UINavigationController.

Why it is needed

The 2 motivations for this change are:

  • It's a burden for new-comers to interact with objective-c
  • Some IOS native SDKs that integrate native view controllers need a UINavigationController for its initialization.

For e.g, MercadoPago which is a payment platform from Latam has a native SDK for IOS that needs to be initialized with a UINavigationController

Possible implementation

This change implies adding the following code in the AppDelegate:

+ UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
+ [navController setToolbarHidden:YES animated:YES];
+ [navController setNavigationBarHidden:YES];

-  self.window.rootViewController = rootViewController;
+ self.window.rootViewController = navController;

Code sample

Here is a working example.

@radko93
Copy link
Collaborator

radko93 commented Jun 22, 2020

Hi! Unfortunately, I will have to redirect you to the main RN repo https://github.com/facebook/react-native. This template only copies native code from RN template and adds some TS configuration. So it has to be changed over there first.

@radko93 radko93 closed this as completed Jun 22, 2020
@JonatanSalas
Copy link
Author

@radko93 sorry! I didn't notice that, my bad! thanks for your response!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants