Last active
July 27, 2016 15:14
-
-
Save ffried/787e71fd284a800246f72e6d6e2bb0fe to your computer and use it in GitHub Desktop.
NS_OPTIONS-Swift
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
//ObjC | |
typedef NS_OPTIONS(NSUInteger, SomeOptions) { | |
SomeOptionsStarted, | |
SomeOptionsWorking, | |
SomeOptionsFailed, | |
SomeOptionsFinished | |
}; | |
// Swift | |
// Generated: | |
public struct SomeOptions : OptionSetType { | |
public init(rawValue: UInt) | |
public static var Started: SomeOptions { get } | |
public static var Working: SomeOptions { get } | |
public static var Failed: SomeOptions { get } | |
public static var Finished: SomeOptions { get } | |
} | |
// RawValues: | |
SomeOptions.Started.rawValue == 0 | |
SomeOptions.Working.rawValue == 1 | |
SomeOptions.Failed.rawValue == 2 | |
SomeOptions.Finished.rawValue == 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment