Quantcast
Channel: SwiftUI build a list using enums - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by green_knight for SwiftUI build a list using enums

You don't need Identifiable here. I've added selections as well, because why not:enum Whatever: String, CaseIterable { case one case two}struct ContentView: View { @Binding var selection: Whatever? var...

View Article


Answer by Chris for SwiftUI build a list using enums

try this:enum Whatever : String, CaseIterable, Identifiable { var id : String { UUID().uuidString } case one = "one" case two = "two"}struct ContentView: View { var body: some View { VStack { List...

View Article

Image may be NSFW.
Clik here to view.

SwiftUI build a list using enums

I am trying to create SwiftUI List based on enum strings. I am faced with this error:Cannot invoke initializer for type 'List<_, _>' with an argument list of type '([HomeView.Data], @escaping...

View Article
Browsing all 3 articles
Browse latest View live




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