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

Adrian Zubarev adrian.zubarev at devandartist.com
Fri Jul 8 06:55:20 CDT 2016


True story, if you’re doing something heavy and there are tons of calls from your observed property you’d pay with a huge performance decrease. Personally I don’t feel like this would be something that stays in the way of having this handy feature, because it’s always up to us to balance the performance of our application.



-- 
Adrian Zubarev
Sent with Airmail

Am 8. Juli 2016 um 13:44:45, Tino Heth (2th at gmx.de) schrieb:

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160708/09eb57bd/attachment.html>


More information about the swift-evolution mailing list