# SwiftUI, a quicker way of doing things

DevFeed: [SwiftUI, a quicker way of doing things](<https://devfeed.tech/articles/swiftui-a-quicker-way-of-doing-things-30801.md>)

Original publisher: [Read original article](<https://devblog.kogan.com/blog/swiftui-a-quicker-way-of-doing-things>)

Author: Guest User

Published: 2024-03-15T09:11:38Z

Content type: tutorial

Language: en

Sources: [Kogan.com](<https://devfeed.tech/sources/kogan-com.md>)

Topics: [SwiftUI](<https://devfeed.tech/topics/swiftui.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [Framework](<https://devfeed.tech/topics/framework.md>), [ui](<https://devfeed.tech/topics/ui.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [app](<https://devfeed.tech/tags/app.md>), [code](<https://devfeed.tech/tags/code.md>), [declarative](<https://devfeed.tech/tags/declarative.md>), [framework](<https://devfeed.tech/tags/framework.md>), [ios](<https://devfeed.tech/tags/ios.md>), [swift](<https://devfeed.tech/tags/swift.md>), [swiftui](<https://devfeed.tech/tags/swiftui.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

This article compares SwiftUI with UIKit for building native iOS app views. It explains SwiftUI's declarative syntax and presents a contacts-list example showing a shorter, more readable implementation, while also noting SwiftUI's earlier limitations and transition considerations.

## Source excerpt

You may have noticed iPhones don't exactly look the same... A lot has changed internally, User Interface (UI) components look far different than they used to. The code to create these views has evolved, and as a result, so have the UI components themselves. Swift, Apple's programming language for creating native iOS apps, has used UIKit as its framework for UI components since 2008. Over time, UIKit has evolved into a robust and flexible framework. In 2019, SwiftUI emerged as a new and faster coding framework to use. However, at the time, developers were not quick to jump on board as SwiftUI was simply not ready. There were no online discussions on using SwiftUI when it first came out, there wasn't as much documentation, and it still needed time for more UI components to come in. 5 years later, this is not quite the case anymore. As Apple plans for SwiftUI to slowly mature and overtake UIKit as the primary framework for iOS Apps, new native components will only continue to evolve. As a result, UI components in iOS devices and the iOS user experience will evolve too. In this blog, we will explore the benefits of making the transition from UIKit to SwiftUI to code views in your project, while also keeping in mind the limitations and pain points you may run into Benefits of SwiftUI vs UIKit - A quick practical demo The benefits SwiftUI offers us largely come from its easy-to-read and code, declarative syntax. Rather than explaining how it's different from UIKit, I think it might be easier to just show you. Contacts List App Example Below I have created two simple apps showing a contacts list, one in UIKit and one in SwiftUI. UIKit - Difficult to understand As you can see below (figure 3), writing in UIKit can be nuanced and difficult to understand to the untrained eye. For this app in UIKit, I had to create both a Storyboard (a place where I can drag and drop objects to create a view) and a viewController to control the data. This is two files and 63 lines. SwiftUI - Eas