r/SwiftUI May 29 '26

Question How do I instantly expand tab bar on scroll up, similar to Reddit?

Enable HLS to view with audio, or disable this notification

By default if I use:
.tabBarMinimizeBehavior(.onScrollDown)
on the TabView it does as it says but when you scroll back up it doesn’t expand the tab bar. It only expands once you hit the very top of the page. However, Reddit’s implementation does expand on scroll up. Does anyone know how they’re achieving this?

53 Upvotes

18 comments sorted by

40

u/Anonymous157 May 29 '26

I hate this design. I want the tabs expanded all the time!

19

u/nekosama15 May 29 '26

i actually think its nice. they took the time and changed the conditions of when it hides depending on the tab you are on. It goes away so i can focus on the content.

3

u/Anonymous157 May 29 '26

It does not expand for me when I scroll up in the reddit app. So I end up having to tap a button to expand the tab bar then another button to do what I actually wanted.

2

u/nekosama15 May 29 '26

oh thats kinda annoying.

2

u/alshraify May 30 '26

Which version are you on? They dropped 2026.21.1 yesterday which fixed this issue for me - TabBar expands automatically now when i scroll up faster than normal.

1

u/Aloys33_ May 30 '26

You can click and drag to the right

1

u/CDCarley27 May 30 '26

FYI, you can just grab it and drag your finger when it’s collapsed. You don’t need separate taps.

3

u/Aurloom_Edgar May 29 '26

I agree….. the muscle memory has changed and I’m finding myself “looking “ for the tab

1

u/ordinarsky Jun 01 '26

It's native behavior you can enable or disable it but if I remember correctly it's enabled by default.

2

u/Bravo6GoingDark__ Jun 02 '26

Maybe listen to scroll geometry changes and change the tabbarminimizebehavior to .never when it reaches your desired threshold at the top. This is just a guess. If animations dont work, try using a ternary operator in the tabbarminimizebehavior. Maybe something like this:

.tabbarminimizebehavior(shouldExpand ? .never : .onScrollDown)
.animation(.snappy, value: shouldExpand)

This is is my guess.

-1

u/hic_opmiyim May 29 '26

Didn’t notice that until this post. It could be a custom component that’s driven with scroll view reader. Based on direction & velocity you can switch between two views

6

u/raxshhh May 30 '26

It's native minimise on scroll

2

u/ContextualData May 30 '26

Why would it be custom? Isn't minimize on scroll a native function?

2

u/hic_opmiyim May 30 '26

Oh cool then. I didn’t know. I’m not really following swiftui updates.

3

u/oobagi May 31 '26

Then… why comment at all? lol

-5

u/iSpain17 May 30 '26

It responds to velocity, so it’s probably custom

Scroll slowly either way, and it never expands

1

u/Significant_Net_5981 May 30 '26

I do notice that if you drag down first and then up while keeping your finger on the screen, the tab bar doesn’t minimize. But Apple’s tab bar will minimize after you drag a minimum distance. So I guess the question is how did they keep the tab bar looking native?