Instance Method

blur(radius:opaque:)

Applies a Gaussian blur to this 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

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