DEV Community

Cover image for Swift vs React Native: Which One Should You Choose to Build Your Mobile App?
Iza Rokita for Railwaymen

Posted on • Updated on • Originally published at blog.railwaymen.org

Swift vs React Native: Which One Should You Choose to Build Your Mobile App?

In the last few years, mobile development has become very influential and beneficial. Many different companies think about creating an app for their service (to, for example, streamline the cost management in their company) or develop one as their product, which will become valuable for the users. Both approaches are focused around the idea, that app development purpose is to bring you money. And it is definitely achievable!

Alt Text

When a company comes up with an idea for an app, their second thought should be: what technology should be used to make it (and even what technologies exist actually). When it comes to mobile apps development, the most popular technology recently is React Native, because the development is seemingly the cheapest and the fastest because of making one application for both Android and iOS. Usually, the thought of making a native app comes as the second one, but after considering the costs of development it is not as attractive because of the need of making two separate applications for both top mobile platforms.

What if it isn’t the best approach? The decision of what technology should you use (Swift vs React Native) needs longer consideration because it is a very important part of the project. I would like to show you some pros and cons of both of these technologies, basing on my professional experience as an iOS Developer. But first of all…

About the React Native vs Swift article author: who am I?

My name is Bartek and I am an iOS developer in the Cracow software house Railwaymen.I've been making mobile apps using Swift for 2,5 years already and I’m still fascinated with Apple’s products because, against all appearances, it has no competition!

Apple gives its users a closed ecosystem developing devices with their own operating system which makes it more secure than products of any other company. Moreover, the main goal of Steve Jobs’ business is the User Experience (UX) and intuitive layout which are also my goals as the developer with an idealistic vision of the world. That’s why I’m so excited about my profession and why this article has been written.

Is Swift native? How can you tell?

Swift is a fairly new programming language released on September 9, 2014, as a substitute for the previously existing on Apple’s platform Objective-C. It is also hosted by Apple, which means that Apple leads and supervises the development and that all components used in Swift are prepared and designed by Apple for their system. This is what makes it native - it is designed exactly to act with iOS.

But what is React Native then?

The word “Native” can be actually misleading. This doesn’t mean that this is native, but that it uses native components. We can understand it after we acknowledge different approaches in the past of mobile apps development. Some of them used to create web applications and run them on iOS as in the browser. React Native differs from them, because it doesn’t create a web page, but uses components created by Apple to build a real application using JavaScript which is strongly used in web development. The main strengths of this technology are the cost and speed of development. But...

Is React Native better than Swift?

Looking at the strengths and weaknesses of both solutions you probably still think why development native apps could be better than using React Native. I wrote at the beginning of the article that the lowest cost of development with React Native is apparent in most cases. It is good for simple apps that really need to be developed as soon as possible or if the application is not important for the prospering of the company (e.g. simple app for checking public transport timetable). Native apps are much better for long-term or more complex projects (e.g. e-learning or streaming platform) because they are easier to maintain and perform better.

Alt Text

Maintainability is a very important factor here, because, for example, if we would like to add to the app, after a few months of a break in the development, a new component, it would determine how much time it would consume to get into the code for the programmer. It is harder to get into JavaScript code used in React Native development than into Swift code because of the construction of these languages. Swift is a dynamically evolving language with frequent updates, which makes creating apps getting easier.

Will React Native replace Swift?

It is hard to tell what technologies will be popular in 10 years, but for now, there’s no technology as well-working as native technologies when it comes to mobile apps. It is so because native apps work quicker and are prettier. Differences in design can be invisible on Android, but for iOS users it’s easy to say if the app has been done with Apple’s guidelines. Yes, React Native uses native components, so doing a good layout is possible, but it is hard to find a React Native app that does it in the right way.

Swift vs React Native: Each Technology Pros and Cons

Now it's time to dive deeper into both of these mobile app development programming languages and acknowledge their strengths and weaknesses. Both Swift and React Native are perfectly fine to build an iOS app. But as it often is in app development world - depending on the type of your project, one can be better than the other. So, without further notice, let's start the ultimate React Native vs Swift competition - enjoy!

Swift advantages & disadvantages

➕ Very organized community - developers can get much help from solutions to problems to guide how their code should be formatted. The community of Swift developers is very constrained to Apple which really cares about the needs of iOS developers and users of their code. That means Swift coding is standardized and every code could be understood by the experienced developer.

➕ Better performance - it is slightly better in a normal-case application because Swift is based on memory usage, but React Native apps base on CPU usage. It makes a much more significant difference in big, complex applications that have solutions that are out-of-the-box.

➕ Quicker updates to the newest version of the iOS - apps built with Swift are really native, and code is low-level which means that every interface Apple does is directly used by developers. So when Apple releases a new version of iOS with new features or new look which have to be at first adapted by the developer, native developers have a codebase needed for releasing the new version really quickly and it’s independent of third party libraries which actually is a React Native framework.

➕ Continuously improved language - it doesn’t mean that Swift is written in the wrong way. It means that writing in this language gets easier and faster with every new version. Apple delivers new frameworks and tools to developers, which make development quicker and easier, and it lowers the costs of development.

➖ The higher cost of development - it’s not higher if the app is being built only on one platform, but if a client wants to have an Android app now or in the future, then cost probably will be higher because business logic has to be written twice in different languages (Swift on iOS and Kotlin on Android).

Alt Text

➖ Frequent updates of the language - this is a continuation of the previous point because it means higher costs of maintenance of the app. Swift is a rapidly evolving language, which is upgraded each year to the new major version. For the developers, the release means, that they have to spend additional time converting current code to the new version, which should be done automatically, but many things have to be done manually. The problems then are unsupported third-party libraries which cannot be used if their Swift version is too low because they need to be updated at first.

React Native advantages & disadvantages

➕ Stable and known language - JavaScript used for the development is known to many people connected mainly with web apps development. Saying that this is stable means that updates aren’t so frequent as in the case of Swift and surely aren’t breaking as frequently as Swift updates. Remember that JavaScript has existed since 1997 which makes the community of developers much bigger than in the case of Swift.

➕ Lower costs of cross-platform application development - it is probably the main advantage that is taken into account when a client decides to choose React Native, that you can develop with it an app both for iOS and Android. So the cost is actually lower if the logical part of the application can be used in the iOS and the Android version. For one-platform applications, this point shouldn’t be considered relevant, because the cost will be comparable.

But remember to be very careful at this point, to not repeat the Airbnb mistake. They've decided to develop their app in React Native yet, it didn't meet their expectations. After all - they had to develop a native app in iOS, losing lots of money that they invested in a cross-platform one done with React. You can read more about it here!

➕ Good for simple application - if you just want to show some information on the user phone’s screen, get some of his data, e.g. to take his order for food or to show when the event he wants to attend will start it is a good technology to do this.

➖ The community should learn a lot - unfortunately, the React Native community comes from web development. Such a developer coming from web development doesn’t know how mobile apps work behind the scenes, understanding of which is really important to avoid common bugs. Thus when choosing this technology it is very important to know what experience the working team has because React Native is easy to get in, but very hard to do apps the way they should be done.

➖ Slower on iOS - it cannot be seen if the developers know how to develop a mobile app and the app isn’t much complicated. But if the client wants some not very common component in his app, the difference can be significant. As I mentioned before, applications built using this technology are based on CPU usage, and complex operations and calculations will be more expensive to the device’s resources than with Swift, which bases on RAM usage.

➖ Dependent to native code - every component, which will be used with React Native should at first be done with native (in most cases Objective-C) code. This means that when Apple releases an update for iOS, Facebook has to release an update to React Native to use new features derived by Apple. After this, developers can use the new interface and new features provided by Apple for iOS.

➖ Size of the app - additional code that enables React Native developers to build the app has its size which influences the size of the app. Native apps are lighter than their React Native equivalent (except apps using RxSwift which is a pretty big framework for Swift).

Conclusion

I don’t want to criticize React Native, because the technology is pretty good and it has legs, but the community of the React Native developers really need to learn many things about the iOS platform, because there are plenty of things to improve. So if you want to learn new technology and you’re looking for information about what’s best, nobody knows what technology will be the best in the future.

In my opinion, React Native will never be as good as native technologies. If you’re doing research which technology is the best for your app, take all the pros and cons I’ve listed into consideration. If you’re oriented to the best user experience, prefer native technologies over the cross-platform ones. But first - get to know how experienced are developers. Because this is what mainly influences the quality of your app!

Now you know which mobile app development language is a better choice in your case. Unfortunately, now the harder part begins. Building an iOS app, no matter if it's native or cross-platform mobile is a complex task. You need to have access to a team of talented developers that will guide you through it all and at the end - deliver to you a fully-functional and testes app.

Happens to be that we're exactly like that! With our +10 years of experience in software development, we'll make something extraordinary for you. Just let us know that you're ready here and the rest will become history!

Top comments (0)