Don't use deprecated interfaceOrientation for detecting portrait mode
This commit is contained in:
parent
203c1852d4
commit
2eda9657ac
|
@ -141,8 +141,8 @@ class MainTabBarViewController: UITabBarController, UITabBarControllerDelegate {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
NSLayoutConstraint.deactivate(fastSwitcherConstraints)
|
NSLayoutConstraint.deactivate(fastSwitcherConstraints)
|
||||||
// using interfaceOrientation isn't ideal, but UITabBar buttons may lay out horizontally even in the compact size class
|
let isPortrait = view.bounds.width < view.bounds.height
|
||||||
if traitCollection.horizontalSizeClass == .compact && interfaceOrientation.isPortrait {
|
if traitCollection.horizontalSizeClass == .compact && isPortrait {
|
||||||
fastSwitcherConstraints = [
|
fastSwitcherConstraints = [
|
||||||
fastSwitcherIndicator.centerYAnchor.constraint(equalTo: myProfileButton.centerYAnchor, constant: -4),
|
fastSwitcherIndicator.centerYAnchor.constraint(equalTo: myProfileButton.centerYAnchor, constant: -4),
|
||||||
// tab bar button image width is 30
|
// tab bar button image width is 30
|
||||||
|
|
Loading…
Reference in New Issue