# SwiftUI

> Apple's way to build app screens in Swift. You say what to show.

**Field:** Software Development  
**Category:** Mobile Development  
**Also known as:** Swift UI

## Think of it like

Think of it like a shopping list. You write what you want, and the store finds where it is.

## Definition

SwiftUI is Apple's way to build screens for its devices in the Swift language. You describe what the screen should show, not each step to draw it. When the data changes, SwiftUI redraws the parts that changed. It works for iPhone, iPad, Mac and Apple Watch apps. It runs only on Apple's systems.

## Example

Emma writes a list of her notes in SwiftUI. When she adds a note, the list updates by itself.

## Example code

```swift
struct ContentView: View {
    var body: some View {
        Button("Say hi") { print("Hi") }
    }
}
```

A SwiftUI screen with one button. You say what to show, and SwiftUI draws it.

## Why it matters

It is the modern way to build native Apple apps. Screens take far less code than the older way.

## Common mistake

Expecting it to build Android apps. SwiftUI is for Apple's systems only.

## Three principles

- **Say what, not how.** You describe the screen, not the steps.
- **Updates itself.** A change in data redraws the screen.
- **Apple only.** It builds apps for Apple's devices.

## Related terms

- [Swift](https://learn.benibix.com/term/development/swift)
- [Native App](https://learn.benibix.com/term/development/native-app)
- [iOS](https://learn.benibix.com/term/development/ios)
- [Xcode](https://learn.benibix.com/term/development/xcode)
- [Jetpack Compose](https://learn.benibix.com/term/development/jetpack-compose)
- [Declarative Programming](https://learn.benibix.com/term/development/declarative-programming)

![A table of four frameworks and who draws the button you see. SwiftUI, written in Swift for iPhone only, is drawn by iOS itself. Jetpack Compose, written in Kotlin for Android, is drawn by Compose on Android. React Native, written in JavaScript for both phones, uses each phone's own native button. Flutter, written in Dart for both phones, paints its own pixels. The two cross-platform rows are lit up.](https://learn.benibix.com/diagrams/dev2-mobile-frameworks.svg)

---

Source: https://learn.benibix.com/term/development/swiftui
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
