[swift-evolution] Proposal: Stored properties in extensions
tomas at linhart.me
Sat Dec 5 17:19:52 CST 2015
very often, it is necessary to define stored properties in extensions. It
is currently only possible in Swift that has access to ObjC runtime with
associated objects (in theory it might be possible with some global
dictionary) and it requires a lot of boilerplate. Associated objects are
used in UIKit quite heavily so it is something that authors of frameworks
It would be nice to able to create properties in extensions natively in
Swift without need of Objective-C and without a boilerplate. These
properties could be marked with some extra keyword/attribute so it is
obvious they are different and they have a cost (depends on their
What do you think?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution