Instance Method

clipped(antialiased:)

Clips the view to its bounding rectangular frame.

Declaration

func clipped(antialiased: Bool = false) -> some View

Parameters

antialiased

A Boolean value that indicates whether smoothing is applied to the edges of the clipping rectangle.

Return Value

A view that clips this view to its bounding frame.

Discussion

By default, a view’s bounding frame is used only for layout, so any content that extends beyond the edges of the frame is still visible. Use the clipped(antialiased:)modifier to hide any content that extends beyond these edges.

See Also

Masking and Clipping Views

func clipShape<S>(S, style: FillStyle) -> View

Sets a clipping shape for the view.

func cornerRadius(CGFloat, antialiased: Bool) -> View

Clips the view to its bounding frame, with the specified corner radius.

func mask<Mask>(Mask) -> View

Masks this view using the alpha channel of the given view.