[swift-evolution] [Idea] Find alternatives to `switch self`
svabox at gmail.com
Sat Apr 9 01:12:35 CDT 2016
On 09.04.2016 6:49, Brent Royal-Gordon wrote:
>> (tl;dr: will Swift 3.0 improve iteration for enum values? Some kind of .next() method for values or .all property. Currently we have a problem with this.)
> There are proposals to do this, but they're on hold at the moment because the guy who was the main driving force got busy with meatspace things. Roughly, you would be able to conform an enum to a ValuesEnumerable protocol which would automatically synthesize an `allValues` static property on it. You could use an extension to do this to an enum that didn't belong to you, so you could get this even if the original author didn't think to add it.
Could you provide a little more information about this ValuesEnumerable
protocol? My Swift says it doesn't know about such protocol.
Strange, but goggle knows nothing about
But I can see ValuesEnumerable in some articles related to C#.
More information about the swift-evolution