News for hackers. Stuff that matters.
Re:Using Swift with Cocoa and Objective-C by roskilli on Friday June 13, 2014 @11:14AM (#7889218)
Well this is rather upsetting, it seems extensions still cannot add stored properties... Back to using objc_setassociatedobject and objc_getassociatedobject it seems for extension properties, sadface.

Also seems you can't override existing methods or properties still (actually achievable with swizzling of methods & property getter/setters on init but always seems way to heavy to use in reality). I would love to have a more mix-in friendly environment at some point in time.

“You can use extensions to add properties (including class and static properties). However, these properties must be computed; extensions can’t add stored properties to classes, structures, or enumerations.”

“You cannot use extensions to override existing methods or properties on Objective-C types.”

Excerpt From: Apple Inc. “Using Swift with Cocoa and Objective-C.” iBooks.

Re:Using Swift with Cocoa and Objective-C by nextstep on Friday June 13, 2014 @11:18AM (#7889237)
Not surprising. Class extensions in Objective-C cannot add stored properties either; objc_setassociatedobject and objc_getassociatedobject are shitty hacks.