I would like to present a sheet with UISheetPresentationController while still showing a tabBar. Is this possible?
UISheetPresentationController behind UITabBar
If the sheet exists across all tabs of your app, you can present UITabBarController inside of UISheetPresentationController. This would result in behavior similar to the Find My app.
If you want the sheet embedded within only one tab of your app, and want totally different UIs on the other tabs, this isn't currently supported. A feedback report would be appreciated if you want support for this use case!
Hello, could we please get an example on how to present UITabBarController inside of a UISheetPresentationController? Thank you!
+1 for a sample. How does presenting a UITabBarController on top of the UISheetPresentationController make the sheet appear behind the tab bar but above the tab view controllers' content?
Only thing I can think of is maybe adding a UITabBar (which is a view) to the sheet itself at the bottom. But then I'd have to basically reimplement UITabBarController functionality from scratch and this would be very disruptive to my app's current structure (probably not worth the effort). That would get the "Find My app" look (which has a sheet that can't be dismissed). In my case I need a sheet that is dismissible.
I think a nice enhancement would be able to specify a passthrough view, or something of that nature on UISheetPresentationController. Something like:
@property (nonatomic,strong,nullable) UITabBar *passThroughTabBar;
So existing UITabBarControllers can easily add a sheet that doesn't block the tab bar. Or maybe something like this:
@property (nonatomic,strong,nullable) CGFloat bottomMargin; //assign the UITabBar's frame height to this so it floats above the tab bar instead of covering it.
It is possible. I found the solution on youtube: https://www.youtube.com/watch?v=8Ys83qvnDvE