An update from the quoted thread above:
Example:
struct Test: View {
		let value: Int?
		var body: some View {
				if case let value? = value {
						Text("\(value)")
				} else {
						Text("Test")
				}
		}
}
I tried to drop your example in it and it does not compile in the existing project. It does compile in a brand new iOS only project, but it does not compile in a brand new macOS project (shared sample iOS and macOS projects): https://www.icloud.com/iclouddrive/01bKAFXVd82HpGZ-3R7RExKeA#ViewBuilder_iOS_macOS
Not sure why it would not work for macOS, there could be the embarrassing thing I was missing and I should have explained it is an iOS + macOS app. So it works as a pure iOS project, but not as a pure macOS project. Will be creating a Feedback report and post the ID here.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: