Instance Method

shadow(color:radius:x:y:)

Adds a shadow to the view.

Declaration

func shadow(color: Color = Color(.sRGBLinear, white: 0, opacity: 0.33), radius: CGFloat, x: CGFloat = 0, y: CGFloat = 0) -> some View

Parameters

color

The shadow’s color.

radius

The shadow’s size.

x

A horizontal offset you use to position the shadow relative to this view.

y

A vertical offset you use to position the shadow relative to this view.

Return Value

A view that adds a shadow to this view.

See Also

Applying Blurs and Shadows to a View

func blur(radius: CGFloat, opaque: Bool) -> View

Applies a Gaussian blur to the view.