background(_:)
Sets the background contents for the hosting configuration’s enclosing cell.
Declaration
func background<S>(_ style: S) -> UIHostingConfiguration<Content, _UIHostingConfigurationBackgroundView<S>> where S : ShapeStyleParameters
- style:
The shape style to be used as the background of the cell.
Discussion
The following example sets a custom view to the background of the cell:
UIHostingConfiguration {
Text("My Contents")
}
.background(Color.blue)