// โญ๏ธ if ... else
struct ContentView: View {
var body: some View {
// _ConditionalContent<Text, Text>
if true { A } else { B }
}
}
// โญ๏ธ switch
struct ContentView: View {
var index: Int
var body: some View {
// _ConditionalContent<
// _ConditionalContent<Text, Image>,
// _ConditionalContent<Color, Rectangle>
// >
switch index {
case 1: Text("hello")
case 2: Image(systemName: "folder")
case 3: Color.pink
default: Rectangle()
}
}
}