0Pricing
SwiftUI Academy · Lesson

Creating a Tappable Button

Build a Button with a label and an action.

Why Buttons Matter

Most apps come alive when you tap something. A Button is the simplest way to let people trigger an action in SwiftUI. 👆

The Button View

A Button is just a view, like Text or Image. You place it in your body and SwiftUI draws a tappable control for you.

Button("Tap me") {
    print("Tapped!")
}

All lessons in this course

  1. Creating a Tappable Button
  2. Styling Buttons
  3. Running Code on Tap
  4. Disabling & Enabling Buttons
← Back to SwiftUI Academy