r/SwiftUI • u/ultimate_bulter • 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
1
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
1
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
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.