Will be SwiftUI new future of IOS development?

Raffaele Colantonio
4 min readApr 1, 2022

--

Development landscape:

Swift’s “Uikit” framework has always been the undisputed king of the iOS development landscape, for its seniority on the scene and above for all maturity of its libraries.

It has now been more than 12 years since we started talking about an evolution of Objective-C that it could take hold in the purely native iOS development industry and it is normal to think that the evolution of this language is inevitable

Uikit and why SwiftUI was born:

Uikit is a front end framework written in Objective-C for the graphical user interface (GUI) of the Apple iOS and tvOS operating systems, particularly focused on the MVC (Model -view-controller) Design-Pattern Model which with its Storyboard and drug-and-drop functional guide Xcode an experience,

the creation of the user interface. Its use has been so vast and requested in the workplace since the mobile App market in those years has been growing more and more. In addition to the Web, its libraries are really large, especially regarding data management.

Well, at the same time in the IOS development it was important to speed up the development phase of the Interface to be able to devote more time on UX (User experience) in the production phase, so that is the way “SwiftUI” was born.

SwiftUI concept:

SwiftUI has proven itself to be an absolute game changer in the world of iOS development due to the fact that SwiftUI offers syntax that is easy to understand and is structured in a way that makes sense.

Not only this, but SwiftUI is a much more powerful library. SwiftUI will only continue to evolve as a powerful language, as Apple continues to shift its focus away from UIKit.

Compared to Uikit, SwiftUi was created to be compatible with the same code also for iPadOS, macOS, tvOS, and watchOS which for the previous framework was almost impossible if not using different views (eg Watch-kit, Tv-os Overview etc..)

SwiftUI takes everything Apple learned from UIKit, and provides developers with much better features that are unavailable in UIKit. One of these features includes creating even more powerful applications while at the same time using less code than UIKit.

I leave an example of a great IOS developer who writes the same App in Uikit and SwiftUI:

“SwiftUI vs UIKit: Comparison of building the same app in each framework”:

https://www.youtube.com/watch?v=qk2y-TiLDZo&t=645s

SwiftUi in the professional field:

we know that a business strategy is mainly based on being able to make the development of a product in the best possible time and above all by reducing production costs, it is obvious that old products and now saturated with problems already solved almost certainly create a winning product.

at the same time it is also normal to think that as long as you are sure of that path it will be difficult to abandon it, in fact this is what inexorably happens to Uikit developers. neither

l 2019 when in California they decided to release the SwiftUi framework they knew well that it would not easily create space in the development market but at the same time starting from the web SwiftUi was immediately loved for its intuitiveness and simplicity especially for the canvas in real time that allows you to understand where to move in the UI while programming, We know that it is difficult for companies, even if they already have projects entirely developed in SwiftUI that can attest to the real potential of the framework.

Obviously we are talking about a very young framework where the compatibility of its products arises mainly for Apple’s Entre-level products with IOS 13.0 or higher and it is normal to think that the production level could be a limit for the earlier versions may be requested for a few years.

SwiftUI with Uikit:

It is important to remember that UIKit and SwiftUI are not mutually exclusive. You can use UIKit code in a SwiftUI view and vice versa. If we want to control the risks associated with using a specific UI framework, we should further engage in controlling its expansion in the codebase. Existing problems with SwiftUI shouldn’t stop you from at least preparing your project for migrating to this framework in the near future. Extract as much business logic as possible from the UI layer and make your UIKit screens data driven. This will give it a sense to migrate to SwiftUI.

I leave an example of how Uikit components can be integrated into a SwiftUI project:

Mkmap-in-SwiftUI[GitHub Project]:

Conclusion:

Can we therefore say that SwiftUi will be able to leave a mark in the future of IOS development? The possibility of creating user interfaces and managing micro-animations in a very intuitive way can undoubtedly enter the professional world of development.
Leaving the Uikit comfort zone and starting a next project directly in SwiftUI will give you satisfaction in terms of timing and product prototyping.

--

--