0PricingLogin
SwiftUI Academy · Lesson

What Is a View?

Learn the View protocol and the body computed property.

Everything Is a View

In SwiftUI, almost everything you see on screen is a view. Text, images, buttons, and even your whole screen are all views. 📱

The View Protocol

A view is any type that conforms to the View protocol. Conforming means you promise to describe what should appear on screen.

struct ContentView: View {
    var body: some View {
        Text("Hello!")
    }
}

All lessons in this course

  1. What Is a View?
  2. Displaying Text on Screen
  3. Introducing View Modifiers
  4. Reading the View Hierarchy
← Back to SwiftUI Academy