Protocol

Shape

A 2D shape that you can use when drawing a view.

Declaration

protocol Shape

Overview

Shapes without an explicit fill or stroke get a default fill based on the foreground color.

You can define shapes in relation to an implicit frame of reference, such as the natural size of the view that contains it. Alternatively, you can define shapes in terms of absolute coordinates.

Topics

See Also

Essentials

Drawing Paths and Shapes

Users receive a badge whenever they visit a landmark in their list. Of course, for a user to receive a badge, you’ll need to create one. This tutorial takes you through the process of creating a badge by combining paths and shapes, which you then overlay with another shape that represents the location.

Building Custom Views in SwiftUI

Create a custom view with data driven transitions and animations in SwiftUI.