Christian Tietze

  • Posts
  • Books
  • Apps
  • Work With Me
  • Contact

Mutating Struct and State Observers: How the Latter Will Be Notified Even for 'No-Ops'

Nov 29th, 2022

I may be 7 years late or so – but until last week, I didn’t realize that didSet property observers would fire when the observed property hasn’t actually changed. All you need is a mutating func that doesn’t even need to mutate. This can be illustrated with a simple piece of code:

Continue reading …

  • ∞ Permalink
  • • Comments
  • • Tags:
    • value-object
    • swift
    • reswift
    • mutation
    • performance

Contact • Newsletter • blog post feed
Become an affiliate • Legal Information • Twitter

Except where otherwise noted, content on this site is licensed CC BY-SA 4.0.