An instance of a type that conforms to ShapeStyle that SwiftUI draws behind the modified view.
edges
The set of edges for which to ignore safe area insets when adding the background. The default value is all. Specify an empty set to respect safe area insets on all edges.
SwiftUI anchors the style to the view’s bounds. For the example above, the background fills the entirety of the label’s frame, which includes the padding:
SwiftUI limits the background style’s extent to the modified view’s container-relative shape. You can see this effect if you constrain the FlagLabel view with a containerShape(_:) modifier:
The background takes on the specified container shape:
By default, the background ignores safe area insets on all edges, but you can provide a specific set of edges to ignore, or an empty set to respect safe area insets on all edges:
Rectangle() .background( .regularMaterial, ignoresSafeAreaEdges: []) // Ignore no safe area insets.