Ok, SwiftUI was released this week so we\'re all n00bs but... I have the following test code:
var body: some View { switch shape { case .oneCircle:
One way to fix this is to use the type eraser AnyView:
AnyView
var body: some View { switch shape { case .oneCircle: return AnyView(ZStack { Circle().fill(Color.red) }) case .twoCircles: return AnyView(ZStack { Circle().fill(Color.green) Circle().fill(Color.blue) }) } }