So I want to have a view which presents conditionally, depending on the state of my model. I understand how to do this if each case has a view to present, but how do I handle the case where I want to show no view in some cases?
For instance:
struct MyView: View {
enum ViewState {
case A, B, C
}
let state: ViewState
var view: some View {
switch state {
case .A:
Text("A State")
case .B:
Text("B State")
case .C:
// empty
}
}
}