This discussion came up recently. I thought I would share my thoughts and suggestions to those in this situation. Especially new programmers.
Before we go any further, let me be clear. I am not advocating either platform and have tried to give balanced and impartial advice.
If you are new to programming, the first thing I recommend is learning just one language at a time. I also recommend reading as much as you can on the general theories and approaches to programming, these will most likely be the same across languages. Plus you will soon discover, programming is a lot more about patterns, practices, and theories than it is syntax of a language.
When it comes to Swift or ReactNative, I feel there are several questions you need to ask yourself.
- Am I targeting or wanting to work with a particular platform?
- Am I planning to write applications that may end up on multiple platforms?
- Am I planning or already have a job that will use a particular platform?
- Do I plan to also work with the Web?
These four questions will give you some of the answers you need to guide your learning. If you have a desire to work for a particular company that already has a direction, or plans to create apps for a targeted audience then clearly I would say go with the plan in place.
Creating applications using a platforms native language is I feel, always the best way both for performance and compatibility. Whilst so called ‘hybrid’ languages are improving performance all the time, I still feel that working with hardware at a native level will yield the best results. There is always lots of arguments on both sides of this discussion, this is just my opinion. So in this case I would say for iOS Swift and Objective-C are better than React Native.
A downside to Swift (at the time of this post) is development platforms. Currently the only easy way to create Swift based applications for iOS is on macOS machines. You can write the code on any platform but submitting to the AppStore and easily testing on devices still requires a Mac, or Hackintosh if you are so inclined, but I do not recommend it.
The languages have excellent online support, both from documentation and learning resources to active communities. I think you can probably solve any problem or question you have just by using the trusty programmer tool that is Google.
If you are concerned about the maturity of each language then here are some numbers worth thinking about.
Swift, has been around since WWDC14. Since then it has (as of this post) reached version three, with many breaking changes between versions. Version 4 is supposedly going to be less destructive to existing code, but you should be aware of the new language growing up, that means painful changes between versions.
ReactNative, has been around internally at Facebook since 2013. The first public appearance was in March 2015. Just like Swift, it is a new language with rapid adoption, although the code base appears to have less breaking changes than Swift with each release.
So in the end, hopefully I have given you somethings to consider when choosing, another option would be both, but one at a time! There is no denying that a growing trend does seem to be developing on non-native platform languages.