DynamicViewProperty

So this is my implementation: SwiftWebUI/DynamicViewProperty.swift at master · SwiftWebUI/SwiftWebUI · GitHub
I'm using Reflection (the lib) to find the offset positions of the properties in the View.

To make the View's value "mutable" one just casts the pointer to a mutable one. Which explains why this works even if the properties are defined as let. Not sure whether that is really sound (optimiser might layout the properties differently?), but I guess the layout should be stable as part of the "ABI".

1 Like