# DynamicProperty PropertyWrapper is not working as I expect it to work

**URL:** <https://forums.swift.org/t/dynamicproperty-propertywrapper-is-not-working-as-i-expect-it-to-work/78422>\
**Category:** Using Swift\
**Tags:** propertywrapper\
**Created:** [March 10, 2025, 10:38pm UTC](https://forums.swift.org/t/dynamicproperty-propertywrapper-is-not-working-as-i-expect-it-to-work/78422 "2025-03-10T22:38:25Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![vanvoorden](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/vanvoorden/32/33619_2.png) [@vanvoorden](https://forums.swift.org/u/vanvoorden)\
**Post date:** [March 11, 2025, 6:13am UTC](https://forums.swift.org/t/dynamicproperty-propertywrapper-is-not-working-as-i-expect-it-to-work/78422/4 "2025-03-11T06:13:31Z")

</div>

`AppStorage` requires iOS 14… which is the same year that `StateObject` was released. That might be a clue. It's possible that `State` alone won't work… could you think of a creative way that `StateObject` could help?

This might have some more clues for you:

> [@How is the \`Published\` property wrapper implemented?](https://forums.swift.org/t/how-is-the-published-property-wrapper-implemented/58223/):
>
> More specifically, how is a [@Published](https://developer.apple.com/documentation/combine/published) member of an [ObservableObject](https://developer.apple.com/documentation/combine/observableobject) wired up to its objectWillChange? I don't know if the magic resides in @Published or in ObservableObject, but the interaction between the two is quite mysterious. I see that objectWillChange has a default implementation that's available when Self.ObjectWillChangePublisher == ObservableObjectPublisher. Is it doing some kind of reflection to identify all the @Published properties of self to subscribe to them? (I know Published …

---

_[View the full topic](https://forums.swift.org/t/dynamicproperty-propertywrapper-is-not-working-as-i-expect-it-to-work/78422)._
