📱SwiftUI
Also known as Swift UI
Apple's way to build app screens in Swift. You say what to show.
Think of it like
Think of it like a shopping list. You write what you want, and the store finds where it is.
Example
Emma writes a list of her notes in SwiftUI. When she adds a note, the list updates by itself.
Why it matters
It is the modern way to build native Apple apps. Screens take far less code than the older way.
Definition
Example code
swift
struct ContentView: View {
var body: some View {
Button("Say hi") { print("Hi") }
}
}Common mistake
Key takeaways
- 1Say what, not how. You describe the screen, not the steps.
- 2Updates itself. A change in data redraws the screen.
- 3Apple only. It builds apps for Apple's devices.