Pierpaolo Pignelli - 2022-11-10
In this article, we discover the differences and the pros and cons of these two iOS frameworks to help you choose the one best suited to your needs.
SwiftUI vs UIKit? Which iOS framework to choose to develop your Apple App? Let's take a look together in this article at the evolution of the two iOS frameworks, used to build the User Interfaces of applications Apple, but also their differences, pros and cons to consider, before you start writing your code!
It's 2019 and Apple announces a new declarative framework that would allow developers to write the same UIs with less code. It is the birth of SwiftUI, which goes alongside the existing iOS framework: UIKit.
Index
Let's start with the evolution of the two user interface development frameworks for iOS.
Swift at the time was just under 5 years old, was rapidly rising, still very moldable, and with plenty of room for new integrations, as well as having many constructs modified from version to version; UIKit, its framework for the iOS user interface, had been in use much longer.
So imagine the announcement of SwiftUI on a hot June in the California summer with the crowd at the Apple Worldide Developers Conference (WWDC19) completely open-mouthed, because no one in the audience could have thought of such a surprise!
SwiftUI Presentation at Apple WWDC 2019
"First reaction, shock!" as someone would say.
Yet, 3 years later the two frameworks coexist without stepping on each other's toes., like two diligent roommates, although each has its own peculiarities.
Let's go into more detail and try to better understand the pros and cons of this new treat.
Present as early as iOS 2 (iOS 16 came out a few weeks ago!) and written in Objective-C, predecessor of Swift, UIKit allows you to build and manage graphical user interfaces e event-based.
SwiftUI interface
Source: Apple Developer
UIKit is part of Cocoa Touch, one of the components of the first iOS SDK released in 2008. It contains a collection of HTML components, CSS e JS that make the Apps made recognizable in the Apple style.
SwiftUI on the other hand is not afraid of comparison and gives its best, for example when the dev uses iOS 14 or even better iOS 15 as the minimum requirement: this allows for better integrations since its first version on iOS 13 had several limitations, one of them being the absence of spinner or progress bar that were introduced with iOS 14.
SwiftUI interface
Source: Apple Developer
One of the merits much vaunted is that of having Apps with little written code and the fact that you can create cross-platform applications (Mac, iPhone or iPad) with the same code. The desire to add widgets to one's App then makes the use of this framework essential.
But let's see the substantial differences between the two sibling frameworks:
Actually, as it stands, anyone answering this would be right because the choice depends on how we will use it!
We want the maximum control over how our App should look? Let's choose UIKit.
We want widgets, multi-compatibility and/or high speed development? Let's turn everything over to SwiftUI.
It is inescapable that the market will slowly push more and more for SwiftUI! It goes without saying that Apple itself will increasingly "gladden" the devs with new additions to make it the new standard for Bitten Apple Apps. I therefore recommend (as I, too, have already been doing for a few months) to start as soon as possible to approach the new framework.
Until the next article! Also here, on the Ulixe Group blog ;)
Pierpaolo Pignelli
The author of this article, has been working at Ulixe as an iOS developer since 2022. A graduate in Computer and Automation Engineering, he has been interested in IT since his teens and was weaned to the videludic world with a Game Boy Color, yellow. He is a lover of basketball and wellness and is an enthusiastic aspiring environmentalist.
Back to our blog to read Pierpaolo's upcoming articles!
Get in touch
Ulixe Group S.r.l. Copyright © Ulixe Group S.r.l. | Lungo Dora Pietro Colletta, 67, 10153, Turin, Italy | VAT IT03305250122 | Rea Number TO1173020