[swift-users] struct property changing calls didSet of the Struct each time, but class won't
2th at gmx.de
Mon Nov 13 10:25:49 CST 2017
> My code depends on the class version didSet but I used the struct version. It took me a long time to debug this out. Is this a knowledge that has been well known already?
Yes, that’s how it’s supposed to be.
It’s a feature of struct which isn’t available with classes (so considering the Objective-C past, the „surprise“ is actually that didSet is called when you do that change to a struct property).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users