How it works
A SwiftUI view is a Swift struct whose body combines smaller views: Text, Image, Button, List, and stacks for layout. State is declared with property wrappers and macros such as @State and @Observable, and when it changes SwiftUI recomputes the affected views. Xcode Previews show the result live while you type.
Introduced in 2019, SwiftUI is the framework Apple now builds around, and some features, such as widgets and Live Activities, can only be built with it. UIKit, the older imperative framework, still powers much of iOS and fills gaps, and the two interoperate, so a SwiftUI app can host a UIKit view and the reverse. Newer SwiftUI features only work on recent iOS versions, which limits them in apps that support older phones.
SwiftUI pros and cons
Pros
- Much less code than UIKit for most screens
- One framework across iPhone, iPad, Mac, Apple Watch, Apple TV and Vision Pro
- Live previews in Xcode
- The only way to build widgets and Live Activities
Cons
- Newer features need recent iOS versions
- Complex or unusual layouts sometimes still need UIKit
- Apple platforms only
When to use SwiftUI
Pick it when
- Any new native iPhone or iPad app
- Apps that should also run on Mac, Apple Watch or Vision Pro
Skip it when
- The app must support much older iOS versions
- One shared codebase for Android and iOS matters more than native polish
SwiftUI pricing
Free
Free with Xcode; publishing apps needs the Apple Developer Program.
Approximate, checked September 2026.What the other tools cost
Related terms
More in Mobile apps
Native iOS