Created
July 21, 2015 22:46
-
-
Save crylico/9826b4f1196658361e40 to your computer and use it in GitHub Desktop.
Swift @objc(<#name>) for enums
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(LRMessage) public enum Message: UInt8 { | |
case Hello = 0 | |
case World = 1 | |
} | |
var x: Message = .Hello | |
x = .World |
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
- (void)test { | |
// Desired | |
LRMessage message = LRMessageHello; | |
message = LRMessageWorld; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment