Build a stretchy header with SwiftUI on iOS 18

preview_player
Показать описание
Let's take a look at SwiftUI's new onScrollGeometryChange view modifier to create a stretchy header effect with little to no workarounds!
Рекомендации по теме
Комментарии
Автор

Thanks for this great video! If I want to have a swiftui map where the image is and still have click through - how would that work?

Magnus-jo
Автор

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....

tokero
Автор

I'm still using geometry in background Color to get offset, which is the only way I tested with acceptable frequency.

RFIHW
Автор

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

xzilja
Автор

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.

wmblemania
visit shbcf.ru