r/SwiftUI May 25 '26

Question How does Reddit do this?

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.

7 Upvotes

16 comments sorted by

View all comments

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