Skip to content

Commit 412104a

Browse files
committed
Some improvements
1 parent 2c24c2e commit 412104a

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

ios/gamma/split-view/RNSSplitViewHostController.swift

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,20 @@ public class RNSSplitViewHostController: UISplitViewController, ReactMountingTra
121121
refreshSecondaryNavBar()
122122
}
123123

124+
/// This function is handling the logic related to the issue described next to `setNeedsSecondaryScreenNavBarUpdate` method which explains the purpose why we need to have another signal.
124125
private func refreshSecondaryNavBar() {
125-
guard let secondaryViewController = viewController(for: .secondary) else { return }
126-
let navigationController = secondaryViewController as? UINavigationController
127-
navigationController?.setNavigationBarHidden(true, animated: false)
128-
navigationController?.setNavigationBarHidden(false, animated: false)
126+
let secondaryViewController = viewController(for: .secondary)
127+
assert(
128+
secondaryViewController != nil,
129+
"[RNScreens] Failed to refresh secondary nav bar. Secondary view controller is nil.")
130+
assert(
131+
secondaryViewController is UINavigationController,
132+
"[RNScreens] Expected UINavigationController but got \(type(of: secondaryViewController))")
133+
let navigationController = secondaryViewController as! UINavigationController
134+
135+
/// The assumption is that it should come in a single batch and it won't cause any delays in rendering the content.
136+
navigationController.setNavigationBarHidden(true, animated: false)
137+
navigationController.setNavigationBarHidden(false, animated: false)
129138
}
130139

131140
// MARK: Helpers

0 commit comments

Comments
 (0)