From 2eda9657ac9a70cd04487b7cda891e0f56c62a09 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 28 May 2023 14:18:13 -0700 Subject: [PATCH] Don't use deprecated interfaceOrientation for detecting portrait mode --- Tusker/Screens/Main/MainTabBarViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tusker/Screens/Main/MainTabBarViewController.swift b/Tusker/Screens/Main/MainTabBarViewController.swift index a2a0adf1..dc3b81b3 100644 --- a/Tusker/Screens/Main/MainTabBarViewController.swift +++ b/Tusker/Screens/Main/MainTabBarViewController.swift @@ -141,8 +141,8 @@ class MainTabBarViewController: UITabBarController, UITabBarControllerDelegate { return } NSLayoutConstraint.deactivate(fastSwitcherConstraints) - // using interfaceOrientation isn't ideal, but UITabBar buttons may lay out horizontally even in the compact size class - if traitCollection.horizontalSizeClass == .compact && interfaceOrientation.isPortrait { + let isPortrait = view.bounds.width < view.bounds.height + if traitCollection.horizontalSizeClass == .compact && isPortrait { fastSwitcherConstraints = [ fastSwitcherIndicator.centerYAnchor.constraint(equalTo: myProfileButton.centerYAnchor, constant: -4), // tab bar button image width is 30