margins(_:_:)
Sets the margins around the content of the configuration.
Declaration
func margins(_ edges: Edge.Set = .all, _ insets: EdgeInsets) -> UIHostingConfiguration<Content, Background>Parameters
- edges:
The edges to apply the insets. Any edges not specified will use the system default values. The default value is All.
- insets:
The insets to apply.
Discussion
Use this modifier to replace the default margins applied to the root of the configuration. The following example creates 10 points of space between the content and the background on the leading edge and 20 points of space on the trailing edge:
UIHostingConfiguration {
Text("My Contents")
}
.margins(.horizontal, 20.0)