Dart / Flutter vs Swift / Native iOS — side-by-side comparison for iOS development. Which one is better?

Pardeep Batra
4 min readSep 25, 2020

--

The battles between programming languages and frameworks never stop. Everyone wants to understand which technology is best for writing code and producing robust, pixel-perfect mobile applications. You probably can guess that there is no right answer to the question: which of software development technologies is the best? That’s because they have different purposes and diverse functionalities. Their main goal is to deliver applications that work fast, look good and offer everything that the potential user would need.

Image-source[Codemagic]

The difference between Dart and Swift

What is Swift?
Swift is a programming language developed by Apple dedicated to native iOS app development. It was released in 2014 and it became extremely popular, deposing Objective-C as the leading technology for building native iOS apps.

XCode is the primary environment used for native iOS app development with Swift. Building software using Swift is claimed to be simple, fast, and based on software development patterns that are known and loved by the community.

In order to develop iOS apps with native tools, we have to use developer tools and frameworks provided by Apple. Apple has great to get started with native iOS development.

What is Dart?
Dart is a multi-platform language released by Google in 2011. It can be used to build Android and iOS applications with just one codebase. This mobile SDK (software development kit) is also becoming one of the mainstream technologies when it comes to mobile app development. That’s because cross-platform programming gets appreciated by developers and their clients alike.

Flutter uses the Dart programming language for developing both iOS and Android apps and also has great available. Flutter is similar to React Native but with the full support of native.

Comparison table:

Image-Source{ Comparison table}

Compare these two on the base of these three points below:

Onboarding process
Build Time
App size

Onboarding process
Native iOS apps can be developed with Swift and Flutter apps are developed with Dart programming language. We need a different setup for both apps.

Native iOS (Swift)
While developing iOS apps with native tools, we’d like to use Xcode the IDE. You just got to have a macOS machine with Xcode installed.

Flutter iOS
In order to develop a Flutter app for iOS, we are going to use Xcode + the Flutter binary installed, although you can also use Android Studio or IntellijIDEA or any other text editor for developing Flutter apps. Flutter’s Getting Started Guide for macOS explains all the setup that is required for iOS development.

Build time
Now that we have built an app for comparison, let’s dive into each app and measure the build time for both the native and the Flutter app. We will compare both the clean build by deleting all the derived data and incremental builds.

Clean build of native iOS (Swift) app
The build time of native iOS apps can be easily measured with Xcode or the xbuild command line tool. In Xcode, we can enable the build timing summary by running the following command.

$ defaults write com.apple.dt.Xcode ShowBuildOperationDuration -bool YES

Clean build of Flutter apps
Flutter apps can be built for both iOS and Android. In this post, we are comparing the iOS part of the Flutter app against native iOS app development. We can build the Flutter apps just for iOS in debug mode using the following command.

$ flutter build ios –debug –no-codesign –simulator

Application size
Now that we have compared all the aspects of native and Flutter apps, it’s time to compare the size of both apps generated by the native Xcode and Flutter.

Native iOS ( Swift)
You can get the app artifact from the Xcode derived data or from the CI server. The app is in the .app format. In the case of our app, the file is in the derived data directory.

Flutter iOS
The build artifacts of Flutter apps are generated in the build/ios/Debug-iPhonesimulator directory of the Flutter project.

FAQs About Flutter Vs. Swift

What is Swift?
Swift is a fast, modern, safe, and interactive programming language developed by Apple for native iOS app development. It has great toolset, documentation, and frameworks.

What is Flutter?
Flutter is an open-source, multi-platform, mobile SDK created by Google which can be used to develop iOS and Android apps with the single source code.

Is Flutter good for iOS?
Yes, Flutter is good for iOS app development. Flutter apps look very close to actual native apps and it supports other platforms like Android with the same source code.

Which is the best between Flutter or Swift for the iOS app development?
Swift is the clear winner when it comes to Flutter vs Swift. Undoubtedly, Flutter offers cross-platform support but Swift is still better for building all things iOS.

Is Dart better than Swift?
There is no obvious answer to that. Although native solution tends to showcase many advantages, Dart will be the best choice when we want to create a product for more platforms — so besides an iOS app, we want an Android app.

We encourage you to contact us so we can discuss your next iOS App Development project. We use Dart / Flutter, Swift, React Native and many other innovative technologies that follow current trends when it comes to mobile app development.

--

--

Pardeep Batra

Pardeep is a mobile app development aficionado with expertise in strategic planning, product innovation, and mobile applications.