Swift needs @dynamic support

Originator:an00na
Number:rdar://22595617 Date Originated:06-Sep-2015 10:39 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Swift 2.0 beta 6
Classification:Enhancement Reproducible:Not Applicable
 
@dynamic properties are necessary for some Cocoa frameworks. One example is Core Data managed objects subclasses. Currently Swift uses a special attribute @NSManaged for that. “However, unlike @dynamic, the @NSManaged attribute is available only for Core Data support.”

It will be great if Core Data is the only use case of @dynamic. But that’s not true. For example, Core Animation layer subclasses also need @dynamic properties to implement custom animations: https://forums.developer.apple.com/thread/12656. So my suggestion is that @NSManaged should be replaced by a more general attribute matching @dynamic.

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!