I'm trying to revive an old thread. I'd like to hear from the community.<br><br>Can we make a swift enum string interoperable with Objective-C?<br><br>Currently NS_STRING_ENUM ports from objective-c to swift but not the other way around.<br><br>I feel that if you can go one direction you should be able to go back.<br><br>@objc<br>enum City: String {<br> case NewYork = "New York"<br>} <br><br>Make this available as a global string in objective -c ?<br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 23, 2016 at 5:55 AM Derrick Ho <<a href="mailto:wh1pch81n@gmail.com">wh1pch81n@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="white-space:pre-wrap" class="gmail_msg">I think enum strings should gain better interoperability with swift. Something like this:
enum City: String {
case NewYork = "New York"
}
This can be ported over to Objective-c like this:
typedef NSString * City;
static City const City_NewYork = @"New York";<br class="gmail_msg"></div>
</blockquote></div>