# SwiftUI

> A declarative/reactive UI framework announced at WWDC2019. Code for macOS, iOS, iPadOS, and watchOS can be written in the same way.

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.

https://developer.apple.com/documentation/SwiftUI

## 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](https://wiki.g15e.com/en/pages/React.txt), 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)](https://developer.apple.com/videos/play/wwdc2019/204): The video that first introduced SwiftUI
- [Introduction to SwiftUI (WWDC2020)](https://developer.apple.com/videos/play/wwdc2020/10119): 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)](https://developer.apple.com/videos/play/wwdc2020/10040)
- [Discover concurrency in SwiftUI (WWDC2021)](https://developer.apple.com/videos/play/wwdc2021/10019/)
- [Demystify SwiftUI (WWDC2021)](https://developer.apple.com/videos/play/wwdc2021/10022/)
	- A detailed explanation of identity, lifecycle, dependency graphs, and more
- [SwiftUI essentials (WWDC2024)](https://developer.apple.com/videos/play/wwdc2024/10150/)

## Changes

- [Introducing SwiftUI: Building Your First App (WWDC2019)](https://developer.apple.com/videos/play/wwdc2019/204): The video that first introduced SwiftUI
- [What's new in SwiftUI (WWDC2020)](https://developer.apple.com/videos/play/wwdc2020/10041)
	- 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)](https://developer.apple.com/videos/play/wwdc2021/10018/)
	- 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 `await` in [Swift](https://wiki.g15e.com/en/pages/Swift%20(programming%20language.txt)).
- [What's new in SwiftUI (WWDC2022)](https://developer.apple.com/videos/play/wwdc2022/10052/)
	- 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)](https://developer.apple.com/videos/play/wwdc2023/10148/)
	- 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)](https://developer.apple.com/videos/play/wwdc2023/10149/)
	- Added [SwiftData](https://wiki.g15e.com/pages/SwiftData.txt)
- [What's new in SwiftUI (WWDC2024)](https://developer.apple.com/videos/play/wwdc2024/10144/)
	- Added ControlWidget support
	- MeshGradient support
	- New symbol effects
	- Custom containers

## See also

- [SwiftData](https://wiki.g15e.com/pages/SwiftData.txt)