Well, this is disappointing: it doesn't seem like the #SwiftUI scrollTransition modifier works with effects that apply Metal shaders (layerEffect, colorEffect, etc).

You can use one and it shows up, but it only renders the initial value and doesn't animate when the scroll phase changes. 🙃

Oh! Even though you apparently can't drive a Shader using ScrollTransitionPhase, there's a different way to pass scroll position info into a shader that *does* work:

If you use the visualEffect modifier on the scroll view's children, it gives you a GeometryProxy without any of the side effects of wrapping your view in a GeometryReader. You can then use `proxy.frame(in: .scrollView)` to figure out where it is in the scroll view and drive your shader values from that

#SwiftUI #ScrollView #iOSDev