SwiftUI
A declarative/reactive UI framework announced at WWDC2019. Code for macOS, iOS, iPadOS, and watchOS can be written in the same way.
Declare the user interface and behavior for your app on every platform.
Features
- single source of truth
- declaration of intention and roles
- (mostly) one way data flow
Broadly similar to major web frontend frameworks such as Svelte, React, and Elm. But it excels at “Declaration of intention and roles,” an aspect badly damaged on the web by things like the Tailwind craze.
Articles and videos
- Introducing SwiftUI: Building Your First App (WWDC2019): The video that first introduced SwiftUI
- Introduction to SwiftUI (WWDC2020): Almost identical to the video above, but with a sandwich app instead of a meeting room app
- Widgets, complications (watchOS), and more were also added
- Data essentials in SwiftUI (WWDC2020)
- Discover concurrency in SwiftUI (WWDC2021)
- Demystify SwiftUI (WWDC2021)
- A detailed explanation of identity, lifecycle, dependency graphs, and more
- SwiftUI essentials (WWDC2024)
Changes
- Introducing SwiftUI: Building Your First App (WWDC2019): The video that first introduced SwiftUI
- What’s new in SwiftUI (WWDC2020)
- Added the Scene API, making it possible to build (most) entire apps in SwiftUI alone
- Widgets, complications (watchOS), and more were also added
- What’s new in SwiftUI (WWDC2021)
- Describes the theme for 2021 as “Deeper adoption,” following Declarative UI in 2019 and 100% SwiftUI Apps in 2020.
- Added asynchronous APIs using the newly introduced
awaitin Swift.
- What’s new in SwiftUI (WWDC2022)
- Added Swift Charts (similar to Observable Plots).
- Added a data-driven navigation API
- Added a MenuBar API
- Added a Custom Layout API
- What’s new in SwiftUI (WWDC2023)
- Added visionOS APIs, including ImmersiveSpace scenes
- Improved MapKit, Swift Charts, and more
- Introduced the Observable macro in place of ObservableObject. See: Discover Observation in SwiftUI (WWDC2023)
- Added SwiftData
- What’s new in SwiftUI (WWDC2024)
- Added ControlWidget support
- MeshGradient support
- New symbol effects
- Custom containers