Xaxxus
Xaxxus

Reputation: 1839

iOS 17 Tab bar is covering custom UIPresentationController

In our app we have a custom bottom sheet (subclass of UIPresentationController). Would love to use UISheetPresentationController but unfortunately we have to support iOS 15. And UISheetPresentationController is lacking in functionality on iOS 15.

When building the app in Xcode 15, iOS 17 devices have the safe area portion of our custom bottom sheet cut off (well, not really, cut off, its behind the tab bar).

This does not happen for iOS 16 and older devices built in Xcode 15.

iOS 17 devices running the production version of the app (built in Xcode 14) do not have this problem.

Upon further inspection of the view hierarchy, it appears as though the containerView of my UIPresentationController is being presented on top of whatever view controller called present(viewContorller:animated:) instead of being on top of the entire view hierarchy.

I have tried the following:

The only thing I have found that works is to present the bottom sheet from my UITabBarController instead of my current view controller:

let newVC = MyVCToPresent()
newVC.modalPresentationStyle = .custom
newVC.transitioningDelegate = MyBottomSheetTransitionDelegate()
vc.tabBarController?.present() // alternatively, I can use the root view in the UIWindow

Has iOS 17 changed the way UIPresentationControllers work?

Upvotes: 2

Views: 1135

Answers (1)

Xaxxus
Xaxxus

Reputation: 1839

Looks like the issue was shouldPresentInFullscreen was false on my BottomSheetPresentationController.

Setting it to true fixed the issue on iOS 17.

Need to do some further testing in previous versions to make sure its not broken there now...

Upvotes: 3

Related Questions