Options Dictionaries vs. Sets of Enums

Erica Sadun: In Swift, you can re-architect this key-based system into a simple enumeration, specifying the valid type associated with each key case. Here’s what this looks like for the five cases listed above. The associated types are pulled from the existing pixel buffer attribute key docs. enum CVPixelBufferOptions { case CGImageCompatibility(Bool) case CGBitmapContextCompatibility(Bool) case … Continue reading Options Dictionaries vs. Sets of Enums