[swift-evolution] [Idea] Find alternatives to `switch self`

Brent Royal-Gordon brent at architechies.com
Fri Apr 8 22:49:51 CDT 2016


> (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.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list