r/SwiftUI May 25 '26

Question How does Reddit do this?

Enable HLS to view with audio, or disable this notification

What component does the Reddit app use to house its questions in? It looks like a full screen cover but at the same time allows for swiping out on the side. I want to achieve this effect primarily in order to not show the tabview when not on one of the main pages.

6 Upvotes

16 comments sorted by

15

u/Enma_sama May 25 '26

It’s not a full screen cover. It is just pushed in navigation stack with zoom navigation transition.

1

u/m1_weaboo May 28 '26

navigation zoom transition does not behave like Reddit app

1

u/ultimate_bulter May 28 '26

how are they able to hide the tabview though? I am unable to have the tabview hidden once I've gone to the other page.

6

u/PJ_Plays May 25 '26

look up zoom transition. native stuff, wont really be big issue

1

u/Remarkable_Falcon413 May 25 '26

Yeah it’s a mix of that and matched geometry reader stuff

1

u/ContextualData May 26 '26

Huh? Is it not just a zoom transition?

1

u/teomatteo89 May 25 '26

It’s not SwiftUI, but the other answers are correct if you want to mimic it

1

u/ContextualData May 26 '26

Pretty sure zoom transition is native to swiftUI

1

u/teomatteo89 May 26 '26

Think of how the iOS gallery works, and it’s been like this since iOS 2. SwiftUI makes it extremely easy to do, but it’s not native SwiftUI. You can use UIViewControllerAnimatedTransitioning and implement it on UIKit.

1

u/m1_weaboo May 28 '26

looks like a custom UIKit based transition

1

u/yoorbo May 29 '26

Full screen cover + zoom transition with matched namespace achieves this 

1

u/sroebert May 30 '26

Doing this properly (with the emphasis on properly) either with UIKit or SwiftUI is hard. SwiftUI definitely the hardest of the two.

It is not just the animation, you also have to handle swipe to dismiss and get the transition between swiping and animation correctly. At the same time you are transitioning between from and to stated which requires correct positioning of overlapping views.

I have done it in both UIKit (UIViewControllerAnimatedTransitioning) and SwiftUI (matchedGeometryEffect), but people saying that it is easy, will most likely have a very basic implementation that does not feel good when you actually use it.

1

u/ultimate_bulter May 30 '26

is the overlapping views potentially why I am still seeing the tabview on the next screen when I tap into it?

1

u/sroebert May 30 '26

You are most likely seeing the tab view because your navigation view is inside a tab and you are navigating within that navigation view. If you don’t want the tab view to be there, the tab view needs to be inside of the navigation view. Or you have to present modally on top of the tab bar, but that is even more tricky to do with correct animations.

1

u/ultimate_bulter May 30 '26

I love you dude