

The lifecycle methods should be easy enough for you to figure out, but importing and calling obj-c libraries might require a bit of work. I haven’t used technique in production, so integrating other libraries in an open question for me. I started this work because I’m looking into turbo modules and objective-c is just too damn hard to understand to the untrained eye, so I’m expecting it will help me solve the mysteries of enabling Turbo Modules. You should now be able to compile your React Native application!Īs stated this doesn’t mean that your app is now running on Swift, but might make it easier for you to add functionality on the native side of things.

The migration process is illustrated here with an example migration.Part 2. A piecemeal migration of an existing Objective-C class to Swift often means adding a Swift extension to the class. You’d prefer to write the new/changed code in Swift. You want to add a new feature to the existing class, or you want to make substantial changes to part of the class. If you try to build the application you will get some errors regarding missing swift dependencies, I can’t really explain why this is happening, but in order to solve it go to your project build setting’s and change the library search paths as follows:ĭelete the old entries and replace them with a single entry looking for the swift-5.2 librariesĪdd a new entry just like the one you left at the project level settings 5. To convert Swift to Objective-C, you need a custom development project since you have to manually convert the code. Walk through of how to convert your Objective-C Code to Swift. Piecemeal conversion of an Objective-C class to Swift Imagine the following scenario: You have a fairly large and complex Objective-C class. #import #import #import #import #import #import #import 4.
