How is the `Published` property wrapper implemented?

Here's a previous thread (2019) where this was also discussed:

The implementation of objectWillChange is a bit sneaky; there is no associated object. Instead we take advantage of knowing the metadata layout and key paths and access the existing storage from our wrapper. On the surface it seems like an associated object but in reality it is more like a metadata lens.

2 Likes