Let's take a look at SwiftUI's new onScrollGeometryChange view modifier to create a stretchy header effect with little to no workarounds!
Пікірлер: 9
@tokero519924 күн бұрын
Cool. Now we just have to way a few years to be able to use it because Apple does not want to backport UI like Android has AndroidX....
@xzilja19 күн бұрын
Hard to tell from the video, but did you by any chance notice a bit "out of sync" in scrolling and transitioning when using this modifier? I just did simple recreation with it and GeometryReader and it seems as if geometry reader is more accurate "reactive". Particularly when scrolling super slow
@DonnyWalsdev19 күн бұрын
I didn't notice any, but I also have to admit I didn't compare and do super slow scrolls so you might be right. Wonder about the overall performance difference though; GeometryReader in general is very slow. It'd be interesting to compare performance on increasingly large and complex views to see if one breaks down where the other doesn't
@w0mblemania24 күн бұрын
Donny, at the beginning of the video, the list of items is overlapping the header in a nasty way. This may be because you have set a fixed height for the rectangle (300 pts). So the image height is being adjusted dynamically, but the rectangle is not. Cheers.
@DonnyWalsdev24 күн бұрын
Do you mean there’s a glitch while I’m messing around with scrolling in the beginning? Not sure why that happened. Changing the rectangles height causes the entire scroll view to glitch unfortunately; otherwise the header image could have been in the scroll view and we wouldn’t have needed the ZStack at all.
@jrgibson13 күн бұрын
@@DonnyWalsdev I noticed that glitch happens with my app in 18 too, I raised feedback for it.