Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit 907ee5e

Browse files
timonusrnystrom
authored andcommitted
Fix deep links now working as expected on cold start of the app. (#2453)
1 parent d9fcef5 commit 907ee5e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Classes/View Controllers/SplitViewControllerDelegate.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ final class SplitViewControllerDelegate: UISplitViewControllerDelegate {
9494
guard let tab = splitViewController.viewControllers.first as? UITabBarController
9595
else { return false }
9696

97-
if splitViewController.isCollapsed {
97+
// isCollapsed can be false even when showing a single view controller on iPhone.
98+
// We check viewControllers.count as well to ensure we don't skip showing view controllers on the nav stack that we'd like to.
99+
// https://github.com/GitHawkApp/GitHawk/issues/2450
100+
if splitViewController.isCollapsed || splitViewController.viewControllers.count == 1 {
98101
if let nav = vc as? UINavigationController, let first = nav.viewControllers.first {
99102
tab.selectedViewController?.show(first, sender: sender)
100103
} else {

0 commit comments

Comments
 (0)