I have a customContentViewFunction() that I like give an empty content like {} or EmptyView as default to it, which I do not have to do it in use case, for example I done same thing for color!
struct ContentView: View {
var body: some View {
customContentViewFunction(content: Text("hello"), color: .green)
// customContentViewFunction() : << Like this one!
}
func customContentViewFunction<Content: View>(content: Content, color: Color = Color.red) -> some View {
ZStack {
Rectangle()
.fill(color)
content
}
}
}