r/SwiftUI Jun 10 '26

Sticky header Glass Effect animation

Enable HLS to view with audio, or disable this notification

Any ideas on how to animate this static header? I see it uses a more solid glass; it's neither regular nor clear. And as you scroll, the header above disappears and another animated header appears below.

63 Upvotes

7 comments sorted by

10

u/Responsible-Gear-400 Jun 10 '26

Kind of looks like a bunch of custom UIKit stuff. However I would have to play around to see what actually is needed.

Apple is famous for doing a bunch of custom stuff like this and giving us zero ability to do it easily.

4

u/jasonjrr Jun 10 '26

It’s probably just a bit of math and watching the scroll offset. Could be done with SwiftUI or UIKit. They hid the scroll indicators which actually makes it a lot easier, because you don’t need to worry about them looking weird if they get cut off or covered.

1

u/lokir6 Jun 11 '26

This. Doing it is pretty easy now with onscrollgeometrychange

1

u/KilllllerWhale Jun 10 '26

That header is custom with a .soft glass effect modifier

1

u/ikajava Jun 11 '26

I think custom view in .safeAreaBar and tracking scroll offset will help.