#DynamicProperty
TIL about DynamicProperty in SwiftUI and I am positive I am not using it properly..
December 28, 2024 at 9:34 PM
Does anyone use DynamicProperty in #SwiftUI? What are its use cases?
I often consider using it for certain business logic actions that can be reused across different views and have access to @Environment out of the box.
December 6, 2024 at 8:50 PM
@dimillian.app maybe any opinions about DynamicProperty?
December 6, 2024 at 8:51 PM
⚡ Big change in Xcode 27: @State is now a Swift macro! @ns_vasilev breaks down what's happening under the hood and highlights an important caveat with lazy initialization. #SwiftUI #iOSDev #Swift #Xcode27

go.peterfriese.dev/swiftui-sta...
SwiftUI: @State is a macro | nsvasilev.com
With Xcode 27, SwiftUI @State transitioned from a property wrapper to a Swift macro. Discover how this under-the-hood rewrite fixes long-standing initialization bugs, manages nodes in the Attribute Graph, leverages DynamicProperty injection, and changes how view invalidation actually works.
nsvasilev.com
August 5, 2026 at 7:33 AM
A new community project, testing release: DYNAMICPROPERTY WIZARD for #Minecraft Bedrock Creators.

This is an in-game Property editor. Just add it to your BehaviorPack and regain control over hidden variables on Entities and the Player.

github.com/abrightmoore...
August 17, 2025 at 3:12 AM
Sorry managed to scramble my replies wit for SwiftUI you can use this. ViewModifier or dynamicProperty

Gotcha: SwiftUI only resolves it when stored directly on a View. Nested or dynamically created → silently nil.

so most cases, I preferred the ViewModifier approach
March 17, 2026 at 6:23 PM
Yes, because dynamicProperty needs a view that holds it, otherwise the Environment etc. can not be propagated.

But I recommend looking into the ShapeStyle protocol for your theming and styling.
You also have access to the environment. I wrote about this here: freiwald.dev/posts/custom...
The Power of Custom ShapeStyle for SwiftUI Theming
The Power of Custom ShapeStyle for SwiftUI Theming
freiwald.dev
December 7, 2024 at 10:37 AM
I see dynamicProperty as an extension to Views. So it is clear that every child also needs to conform to dynamicProperty.
And the benefit is, that you can change the state of the dynamicProperty during view-updates. Thats why the update function gets called.
December 7, 2024 at 10:38 AM
So I tried this and it is a bit finicky in how it works. First of all you cannot nest without the paren also being a DynamicProperty or the values do not `flow` through to the child property. Second it appears that you swiftUI calls update in the body on any property that implements DynamicMember1/2
December 7, 2024 at 12:50 AM
So a more life worth example would be a swiftui view with a service structure that conforms to DynamicProperty, (what a generic name btw), that you would like to have a snapshot of but the data comes from a json stub. You could inject a new service that stubs the data. 1/2
December 6, 2024 at 10:57 PM
Bindings magic, this took a while. The now has the concept of DynamicProperty and PW's, and State is one of them. Instead of assigning them to a special `state` subject, they just become regular instance variables of the `View`.
The `List` does the binding […]

[Original post on mastodon.social]
April 26, 2025 at 6:17 PM
💡 Connect SPFx web parts with dynamic data: publisher; subscriber pattern in action

Manoj Verma demos a date picker driving a calendar with IDynamicDataCallable and DynamicProperty; change notifications keep it in sync.

📺 Watch now → youtu.be/nXgxoeHOyC8

#Microsoft365Dev #SPFx #SharePoint
September 12, 2025 at 10:13 AM
This pattern allows us to use WebPage in View as a @State object and with our @Observable ViewModel.

But how can the ViewModel access environment objects?

The answer might lie in the DynamicProperty protocol and injecting the ViewModel via the environment.

#Swift #SwiftUI

3/4
July 3, 2025 at 12:56 PM