Option Sets in Swift

Ole Begemann: Swift imports this definition not as an enum, but as a struct that conforms to the OptionSet protocol. Why a struct and not an enum? Enums are great when the cases are mutually exclusive, i.e. only one option can be set at a time. But you can’t combine multiple enum cases into a … Continue reading Option Sets in Swift