diff --git a/Tusker/Screens/Utilities/SplitNavigationController.swift b/Tusker/Screens/Utilities/SplitNavigationController.swift index 63e8433c60..28200572e9 100644 --- a/Tusker/Screens/Utilities/SplitNavigationController.swift +++ b/Tusker/Screens/Utilities/SplitNavigationController.swift @@ -241,13 +241,19 @@ class SplitNavigationController: UIViewController { // otherwise the secondary nav's contents disappear immediately, rather than sliding off-screen let animator = UIViewPropertyAnimator(duration: 0.35, curve: .easeInOut) { self.isLayingOutForAnimation = true - self.setSecondaryVisible(false) + NSLayoutConstraint.deactivate(self.constraints) + self.constraints = [ + self.rootNav.view.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: self.rootNav.view.bounds.minX), + self.rootNav.view.trailingAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.trailingAnchor), + self.secondaryNav.view.widthAnchor.constraint(equalToConstant: self.secondaryNav.view.bounds.width), + ] + NSLayoutConstraint.activate(self.constraints) self.view.layoutIfNeeded() } animator.addCompletion { _ in - self.secondaryNav.viewControllers = [] self.isLayingOutForAnimation = false -// self.updateSecondaryNavVisibility() + self.secondaryNav.viewControllers = [] + self.updateSecondaryNavVisibility() } animator.startAnimation() } else {