[swift-evolution] Pitch: Expose enum properties backed by bridgeable types to Objective-C

Charles Srstka cocoadev at charlessoft.com
Thu Dec 15 00:28:20 CST 2016


> On Dec 15, 2016, at 12:16 AM, Derrick Ho <wh1pch81n at gmail.com> wrote:
> 
> You can currently access swift enums from objective c provided that it is marked @objc and inherits from Int.

Not when I try it:

enum MyEnum: Int {
    case foo = 0
    case bar = 1
}
    
@objc var myEnum: MyEnum = .foo // Property cannot be marked @objc because its type cannot be represented in Objective-C

Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161215/97e878e3/attachment.html>


More information about the swift-evolution mailing list