[swift-evolution] [Discussion] Allow injection of `didSet` and `willSet`

Tino Heth 2th at gmx.de
Fri Jul 8 06:43:43 CDT 2016


There are (were?) plans for generalized property behaviors; those would be used to implement lazy, as well as didSet/willSet, and could incorporate many other things (including injection)

Of course, an option to observe variables would be handy — but there's always a price to pay, and you'll at least need a way to opt-out: Even if you actually don't observe a property that changes hundreds of times per second, the hooks alone could degrade performance (it's another question if it's wise to have such properties ;-)

Tino


More information about the swift-evolution mailing list