Skip to content

Instantly share code, notes, and snippets.

@krzyzanowskim
Created November 18, 2019 16:29
Show Gist options
  • Save krzyzanowskim/0fb36d6f0cdcd5bb17330acbf3897fb5 to your computer and use it in GitHub Desktop.
Save krzyzanowskim/0fb36d6f0cdcd5bb17330acbf3897fb5 to your computer and use it in GitHub Desktop.
flags
class Foo {
struct Flags: OptionSet {
let rawValue: Int
static let one = Flags(rawValue: 1 << 0)
static let two = Flags(rawValue: 1 << 1)
static let three = Flags(rawValue: 1 << 2)
}
private(set) var _flags: Flags = [.one, .two]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment