Instance Method

shadow(color:radius:x:y:)

Adds a shadow to this 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 this view.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software