A ForEach
element needs a binding, so another option I tried is to use .constant
within the ForEach
. This does mean you might have to use item.wrappedValue
to access properties.
ForEach(.constant(Whatever.allCases)) { item in Text(item.wrappedValue.rawValue)}