Ellipse

Published Dec 12, 2022
Contribute to Docs

The Ellipse is one of SwiftUI pre-built shapes like rectangles and circles.

Syntax

var body: some View {
    Ellipse()
        Modifiers here
}

Example

The following example makes a blue Ellipse with a dimension of 150 points wide by 50 points high:

var body: some View {
Ellipse()
.fill(.blue)
.frame(width: 150, height: 50)
}

This will display the following:

Ellipse

All contributors

Looking to contribute?

Learn SwiftUI on Codecademy