Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,9 @@ - (void)tabSafeAreaInsetsDidChange:(UIEdgeInsets)insets
{
CGRect tabBarFrame = _tabBarController.tabBar.frame;
CGRect bounds = _tabBarController.view.bounds;
BOOL hasBottomTabBar = !_tabBarController.tabBar.hidden && CGRectGetWidth(tabBarFrame) >= CGRectGetWidth(bounds) &&
CGRectGetMaxY(tabBarFrame) >= CGRectGetMaxY(bounds);
// Where a floating tab bar along the top replaces it, as on iPad, the tab bar has no window.
BOOL hasBottomTabBar = _tabBarController.tabBar.window != nil && !_tabBarController.tabBar.hidden &&
CGRectGetWidth(tabBarFrame) >= CGRectGetWidth(bounds) && CGRectGetMaxY(tabBarFrame) >= CGRectGetMaxY(bounds);
if (hasBottomTabBar) {
insets.top = MAX(insets.top, LegacyTopInset);
// Never go below the system inset: anything less leaves content under the tab bar, where taps switch tabs.
Expand Down
Loading