Okay one for the crowd: Do we have a definitive answer whether a List's selection binding should be Identifiable or not?

Apple seem to play fast and loose with this. Some of their example projects (Food Truck) don't conform to Identifiable, and the Swift header for List only has Hashable as the requirement. Meanwhile the docs say a List's selection should conform to Identifiable.

So what is the truth? What do you do in your apps?

@phill But list supports elements that are not identifiable (by supplying an id keypath). How would that work if selection required Identifiable?

Follow

@kaybutter well there does appear to be a separate overload for Identifiable elements, and the docs seem to suggest you should be using that. But you're right, you can use none Identifiable elements and it’ll just use the hash. I'm just curious if it has any practical implications, and if it could explain some of my List weirdness.

Sign in to participate in the conversation
The Not So Big Company

The home of The Not So Big Company on Mastodon.