Quantcast
Viewing all articles
Browse latest Browse all 4

Answer by Chris for SwiftUI build a list using enums

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)}

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>