If you’re in mobile app development it’s likely you have a preferred framework to work with such as React Native – the open-source product created by Facebook with a well-earned reputation as the ‘go to’ approach when creating mobile solutions for cross platform applications.
React Native serves us well; we can launch apps from scratch to production in a short space of time thanks to the declarative and modularized programming approach the technology provides. It’s also responsible for some of the world’s most utilized apps including AirBnB, UberEats and Instagram. This framework isn’t popular by accident! But technology moves quickly, so it’s critical that any professional in the digital space keeps an eye on new innovations that may result in better approaches and solutions.
One such new(ish) kid on the block is SwiftUI – Apple’s framework for building declarative UI. SwiftUI was launched in 2019 for iOS development and since then has gained traction among the development community. But when should developers choose SwiftUI over React Native – and when shouldn’t they? Let’s examine a few of the pros and cons.
- Developers can move at a very fast pace… even faster than React Native!
- Creating views is as easy as writing a few lines of code.
- Animations are a breeze to add.
- Programming concepts such as modularized components and shared application state help in writing cleaner code, which is easy to reiterate and reuse. Concepts like these make it easy for React developers to adapt to the new SwiftUI concepts which is a step away from traditional MVC based imperative programming.
- SwiftUI is iOS only framework. You can build applications for the iOS, macOS, iPadOS, tvOS and watchOS platforms but to support Android you will need to rewrite your application into another language.
- SwiftUI only works on iOS 13.0 onwards (which has 94% platform outreach at the time of writing this blog). If your application has to support previous iOS versions, you can’t use SwiftUI.
So, which do we recommend… React Native or SwiftUI?
The answer is… it depends! Ultimately, the technology you choose to build your app is solely reliant on the situation. For example, if you want your application to be blazingly fast with beautiful and obscure animations, a mind-blowingly awesome user experience and are willing to support only the iOS platform then SwiftUI is your best bet. But if your application doesn’t depend heavily on performance and can compromise on a native user experience – or your goal is to reach out to as many users as possible on both iOS and Android platforms – React Native is still the way to go for. Afterall, React is a web first framework and sharing code between all platforms is hard to beat!