DEV Community

Cover image for Understanding SwiftUI - What is SwiftUI? 🧐
Shivam Maggu
Shivam Maggu

Posted on β€’ Originally published at blog.shivammaggu.com on

Understanding SwiftUI - What is SwiftUI? 🧐

In this concise and no-nonsense article, let's postulate what SwiftUI is and why it is all the hype within the iOS developer community.

Table of Contents

Requirements

  • The minimum deployment target version is iOS 13 and above.

  • SwiftUI development is supported by Xcode version 11 and above.

The basics

  • SwiftUI is a UI Design Framework just like its predecessor, the UIKit.

  • It uses the Declarative programming approach as opposed to Imperative programming.

  • In simple words, we inform the framework of what should be done based on a state change and it handles the rest.

  • Whereas in the Imperative approach, we keep track of the state and instruct the framework on how to change the UI.

  • SwiftUI uses struct to create views instead of class.

Pros

  • SwiftUI helps developers write simple, clean and less code.

  • It manages the state better than the Imperative approach of UIKit.

  • Supports cross-platform development for iOS/iPadOS, macOS, tvOS and watchOS.

  • It uses Live Previews instead of building the project to view UI changes.

  • There are no auto layout issues as it always generates satisfiable layouts.

  • People working in teams no longer have to suffer merge conflicts in storyboards. 😜

  • It can be used alongside UIKit using UIHostingController.

  • It supports reactive programming using ObjectBinding, BindableObject and the Combine Framework.

Cons

  • Users with iOS version 12 and below will not be able to use apps developed with SwiftUI.

  • Team development might take more time as others might not be familiar with SwiftUI.

Heroku

Deliver your unique apps, your own way.

Heroku tackles the toil β€” patching and upgrading, 24/7 ops and security, build systems, failovers, and more. Stay focused on building great data-driven applications.

Learn More

Top comments (0)

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup πŸš€

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

πŸ‘‹ Kindness is contagious

Dive into this insightful write-up, celebrated within the collaborative DEV Community. Developers at any stage are invited to contribute and elevate our shared skills.

A simple "thank you" can boost someone’s spiritsβ€”leave your kudos in the comments!

On DEV, exchanging ideas fuels progress and deepens our connections. If this post helped you, a brief note of thanks goes a long way.

Okay