Provide a generic mechanism for bridging to corresponding Objective-C types

Originator:oliver
Number:rdar://17369908 Date Originated:2014-06-19
Status:Open Resolved:
Product:Developer Tools Product Version:6.0 (6A216f)
Classification:Enhancement Reproducible:Always
 
Summary:
Swift's automatic bridging to Objective-C is great. However there are a number of compiler/language/runtime features that seem to be out of bounds of Swift developers.  For example there doesn't seem to be a generic way of defining Swift<->Objective-C data type bridging.

Eg, Swift's Array is bridged (and can be passed in place of) NSArray.

Please provide a generic mechanism where Swift developers can define bridges to Foundation or custom Objective-C classes.  Ie, why can't I define my own List<T> generic data type that can also be easily bridged to NSArray or my own Set<T> that is bridged to NSSet.

Steps to Reproduce:


Expected Results:
That the language bridging features of Swift were exposed to Swift developers to aid in integrating Swift with Objective-C, Core Foundation and other languages, frameworks and libraries.

Actual Results:


Version:
Version 6.0 (6A216f)

Notes:


Configuration:


Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!