Last active
August 29, 2015 14:20
-
-
Save 3lvis/113bcf23dc8255f09712 to your computer and use it in GitHub Desktop.
Enums in Swift and Objective-C
This file contains hidden or 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
// Swift | |
enum StatusCode: Int { | |
case Unknown = 0 | |
case Unauthorized = 401 | |
case Forbidden = 403 | |
case InternalServerError = 500 | |
case ServiceUnavailable = 503 | |
} | |
// Objective-C | |
typedef NS_OPTIONS(NSInteger, NetworkingStatusCode) { | |
NetworkingStatusCodeUnknown = 0, | |
NetworkingStatusCodeUnauthorized = 401, | |
NetworkingStatusCodeForbidden = 403, | |
NetworkingStatusCodeInternalServerError = 500, | |
NetworkingStatusCodeServiceUnavailable = 503 | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment