From c11390398000ddc792635e7f9586bb7c94169a5b Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 21 Aug 2024 18:37:20 -0400 Subject: [PATCH] Fix SplitNavigationController layout with new sidebar --- .../Screens/Utilities/SplitNavigationController.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tusker/Screens/Utilities/SplitNavigationController.swift b/Tusker/Screens/Utilities/SplitNavigationController.swift index 2e0cf2bb6e..63e8433c60 100644 --- a/Tusker/Screens/Utilities/SplitNavigationController.swift +++ b/Tusker/Screens/Utilities/SplitNavigationController.swift @@ -87,7 +87,7 @@ class SplitNavigationController: UIViewController { NSLayoutConstraint.activate([ rootNav.view.topAnchor.constraint(equalTo: view.topAnchor), rootNav.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), - rootNav.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), + rootNav.view.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor), separatorView.topAnchor.constraint(equalTo: view.topAnchor), separatorView.bottomAnchor.constraint(equalTo: view.bottomAnchor), @@ -196,13 +196,13 @@ class SplitNavigationController: UIViewController { NSLayoutConstraint.deactivate(constraints) if visible { constraints = [ - rootNav.view.trailingAnchor.constraint(equalTo: view.centerXAnchor), - secondaryNav.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), + rootNav.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor), + secondaryNav.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor), ] } else { constraints = [ - rootNav.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), - secondaryNav.view.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.5), + rootNav.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor), + secondaryNav.view.widthAnchor.constraint(equalTo: rootNav.view.widthAnchor), ] } NSLayoutConstraint.activate(constraints)