0PricingLogin
SwiftUI Academy · Lesson

Built-in Shapes

Draw Rectangle, Circle, Capsule, and RoundedRectangle.

Shapes Are Views

SwiftUI gives you ready-made shapes you can drop in like any view. They draw themselves and fill the space you give them. 🔷

The Rectangle

A Rectangle is the simplest shape: a plain box. It expands to fill whatever frame or container holds it.

Rectangle()
    .fill(.blue)
    .frame(width: 120, height: 60)

All lessons in this course

  1. The Color Type & Asset Colors
  2. Linear, Radial & Angular Gradients
  3. Built-in Shapes
  4. Stroke, Fill & overlay
← Back to SwiftUI Academy