Contents

Shape

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

Declaration

protocol Shape : Sendable, Animatable, View, _RemoveGlobalActorIsolation

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

Getting standard shapes

Defining a shape’s size and path

Transforming a shape

Setting the stroke characteristics

Filling a shape

Setting the role

Indicating a layout direction

Performing operations on a shape

Instance Methods

Type Methods

See Also

Defining shape behavior