4

I am new to react native. I am adding react native in my existing iOS app which is partially in Objective C and Swift. I have added Native Module support, bridging in existing app. I don't know how to open a existing ViewController in swift from React Native Page.

I have gone through below link: How to go to specific native view controller from react-native code?

But don't know how to present or instantiate ViewController using RCT_EXPORT_METHOD, RCT_EXPORT_MODULE. Like in Android using @ReactMethod I can easily start new Activity from react native button click. Please help me with how can I open ViewController from react native page.

1
  • Have u got this working ? Are you able to open the Native view controller from react native Commented Feb 11, 2021 at 6:12

1 Answer 1

2

Have you tried this one: https://stackoverflow.com/a/46007680/4189507 ?

I was manage to do this in my application. It took me a few weeks to fully integrate react-native with native iOS and android (passing data, events etc. between them).

My current flow:

  • running iOS native app with button "go to React-Native app"
  • click on that button will open new Controller with react-native application.
  • there is a button "go back" which simply closing the "react-native controller".

You can call native swift / objective-c methods from react-native using RCT_EXPORT_METHOD.

Im not sure if this is what you are looking for.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.