2

Can I push a new UIViewController from react-native to Objective-C Native bridge? I want to run the native screen from react-native. I don't want to implement native UI to a react-native component.

1
  • have you found any solution that works Mar 6, 2020 at 11:21

1 Answer 1

1

If I understand your question correctly you want to display your own UIViewController in the react-native app. So to implement this create a new NativeModule on the native ios side and access it on the react-native side. You can check how to do that here

Then you can call a function on this module. Then to present your UIViewController you need to access rootViewController as shown in the code below:

UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;

[rootViewController presentViewController:yourViewController animated:YES completion:nil];

So in this way, you can present your own UIViewController.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.