background(content:)
Sets the background contents for the hosting configuration’s enclosing cell.
Declaration
func background<B>(@ViewBuilder content: () -> B) -> UIHostingConfiguration<Content, B> where B : ViewDiscussion
The following example sets a custom view to the background of the cell:
UIHostingConfiguration {
Text("My Contents")
}
.background {
MyBackgroundView()
}