[swift-evolution] [Review] SE-0139: Bridge Numeric Types to NSNumber and Cocoa Structs to NSValue

Joe Groff jgroff at apple.com
Mon Sep 12 12:37:53 CDT 2016


> On Sep 10, 2016, at 7:52 PM, Karl via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I know the review is over, but I just wanted to chime in with something: does this extend to types which are RawRepresentable as numeric types, too? 
> 
> For example, Cocoa and UIKit have several option-set types which must be placed in dictionaries. Just now I tried to use UIFontDescriptorSymbolicTraits and it crashed at runtime (radar://28244679).
> 
> I consider the current behaviour extremely surprising and definitely a bug.

No, that would require separate consideration. It does make sense to me for NS_ENUMs and NS_OPTIONS types from Cocoa to bridge this way, though.

-Joe


More information about the swift-evolution mailing list