From 634f34405bb49b04a8db512e92eaf2916435c53c Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Tue, 30 Apr 2019 14:02:09 +0200 Subject: [PATCH] Only hide toolbar in debug log Split view controller is shi**y enough not to handle navigation bar properly on rotation. When in compact mode, the navigation bar comes from the split view controller. Hiding it and then going to regular (landscape), will leave the master without the navigation bar and no way to restore it. --- Passepartout-iOS/Scenes/DebugLogViewController.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Passepartout-iOS/Scenes/DebugLogViewController.swift b/Passepartout-iOS/Scenes/DebugLogViewController.swift index 4b884642..f9705529 100644 --- a/Passepartout-iOS/Scenes/DebugLogViewController.swift +++ b/Passepartout-iOS/Scenes/DebugLogViewController.swift @@ -76,9 +76,10 @@ class DebugLogViewController: UIViewController { // MARK: Actions @objc private func toggleBars() { - let isHidden = navigationController?.isToolbarHidden ?? true - navigationController?.setNavigationBarHidden(!isHidden, animated: true) - navigationController?.setToolbarHidden(!isHidden, animated: true) + let nav = navigationController + let isHidden = nav?.isToolbarHidden ?? true +// nav?.setNavigationBarHidden(!isHidden, animated: true) + nav?.setToolbarHidden(!isHidden, animated: true) } @IBAction private func share(_ sender: Any?) {