Created
November 1, 2014 05:41
-
-
Save saniul/d429c9d0114e4fed6108 to your computer and use it in GitHub Desktop.
Corrected NSHipser RawOptionSetType Xcode Snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct <# Options #> : RawOptionSetType { | |
var rawValue: UInt = 0 | |
init(nilLiteral: ()) { } | |
init(rawValue: UInt) { self.rawValue = rawValue } | |
static func fromMask(raw: UInt) -> <# Options #> { return self(rawValue: raw) } | |
static func fromRaw(raw: UInt) -> <# Options #>? { return self(rawValue: raw) } | |
func toRaw() -> UInt { return self.rawValue } | |
static var allZeros: <# Options #> { return self(rawValue: 0) } | |
static var None: <# Options #> { return self(rawValue: 0b0000) } | |
static var <# Option #>: <# Options #> { return self(rawValue: 0b0001) } | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment