[swift-evolution] Ad hoc enums / options
rparada at mac.com
Wed Jun 1 20:48:36 CDT 2016
> On May 31, 2016, at 3:04 PM, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
> let _ = scaleAndCropImage(image: myImage, toSize: size, operation: .fill)
> You would not be able to assign `.fill` to a variable and use that for the operation value.
This is my objection to this idea. It does not encourage reuse.
I would not be able to assign to a variable:
let selectedOperation = .fill
In order to then do this later in the program:
scaleAndCropImage(image: myImage, toSize: size, operation: selectedOperation)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution