{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreihqlejoumo6fxb44rbh7rembmpk76b52tzdox2n7n5zmzxtpygla4",
"uri": "at://did:plc:5sgu76a53rz3n6unbykmovqy/app.bsky.feed.post/3mloith4twwz2"
},
"description": "SwiftUI is Apple's declarative UI framework for building user interfaces across iOS, iPadOS, macOS, watchOS, tvOS, and visionOS. Introduced in 2019, SwiftUI uses Swift's strong type system and result builders to let developers describe the UI as a function of state; the framework diffs and renders updates automatically.\n\n\nCore ideas\n\n * Declarative. Describe what the UI should look like; let the framework figure out the diffs and animations.\n * State-driven. Properties marked @State, @Binding, @",
"path": "/engineering-glossary/swiftui-apple-declarative-ui/",
"publishedAt": "2026-05-12T19:16:05.000Z",
"site": "https://sahilkapoor.com",
"tags": [
"Swift",
"iOS",
"Jetpack Compose",
"React Native",
"@State",
"@Binding",
"@StateObject",
"@ObservedObject",
"@Environment",
"@AppStorage"
],
"textContent": "**SwiftUI** is Apple's declarative UI framework for building user interfaces across iOS, iPadOS, macOS, watchOS, tvOS, and visionOS. Introduced in 2019, SwiftUI uses Swift's strong type system and result builders to let developers describe the UI as a function of state; the framework diffs and renders updates automatically.\n\n## Core ideas\n\n * **Declarative.** Describe what the UI should look like; let the framework figure out the diffs and animations.\n * **State-driven.** Properties marked `@State`, `@Binding`, `@StateObject`, `@ObservedObject`, `@Environment`, `@AppStorage` trigger view updates.\n * **Composable.** Views are values; small reusable views compose into screens.\n * **Cross-platform.** The same view code can target multiple Apple platforms with platform-specific tweaks.\n * **Previews.** Xcode renders SwiftUI views in real time without running the app.\n\n\n\n## SwiftUI vs UIKit\n\n * **SwiftUI.** Declarative, less boilerplate, faster iteration; some edge cases still require dropping into UIKit.\n * **UIKit.** Imperative, mature, dominant in production codebases for the past 15 years.\n * **Coexistence.** SwiftUI views can host UIKit (and AppKit) and vice versa via `UIViewRepresentable` and `UIHostingController`.\n\n\n\nš\n\n**Related Terms**\nSwift, iOS, Jetpack Compose, React Native.",
"title": "SwiftUI",
"updatedAt": "2026-05-13T19:14:26.032Z"
}