Instance Method

blur(radius:opaque:)

Applies a Gaussian blur to the view.

Declaration

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

Parameters

radius

The radial size of the blur. A blur is more diffuse when its radius is large.

opaque

A Boolean value that indicates whether the blur renderer permits transparency in the blur output. Set to true to create an opaque blur, or set to false to permit transparency.

Discussion

The following shows two versions of the same image side by side; at left is the original, and at right is a duplicate with its blur radius set to 10:

See Also

Applying Blurs and Shadows to a View