Contents

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 : View

Discussion

The following example sets a custom view to the background of the cell:

UIHostingConfiguration {
    Text("My Contents")
}
.background {
    MyBackgroundView()
}

See Also

Setting the background