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

Commit 6751331

Browse files
Huddiernystrom
authored andcommitted
Tabbar hide fix (#2509)
* Commented out line dealing with hiding bottombar * Updated tests, removed commented out hidesBottomBar * Fixed tests * Fixed some warnings by swiftlint
1 parent ff27e21 commit 6751331

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

Classes/View Controllers/SplitViewControllerDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class SplitViewControllerDelegate: UISplitViewControllerDelegate {
3232
let secondaryNav = secondaryViewController as? UINavigationController {
3333

3434
let collapsedControllers = secondaryNav.viewControllers.filter {
35-
$0.hidesBottomBarWhenPushed = true
35+
3636
// remove any placeholder VCs from the stack
3737
return ($0 is SplitPlaceholderViewController) == false
3838
}

FreetimeTests/SplitViewTests.swift

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,22 @@ class SplitViewTests: XCTestCase {
108108
masterTab.selectedIndex = 1
109109

110110
let detailNav = UINavigationController()
111-
let detail1 = UIViewController()
112-
let detail2 = UIViewController()
111+
112+
let detail1 = RepositoryViewController(
113+
client: GithubClient(userSession: nil),
114+
repo: RepositoryDetails(
115+
owner: "Foo",
116+
name: "Bar"
117+
))
118+
119+
let detail2 = IssuesViewController(
120+
client: GithubClient(userSession: nil),
121+
model: IssueDetailsModel(
122+
owner: "Foo",
123+
repo: "Bar",
124+
number: 0
125+
))
126+
113127
detailNav.pushViewController(detail1, animated: false)
114128
detailNav.pushViewController(detail2, animated: false)
115129

@@ -131,8 +145,13 @@ class SplitViewTests: XCTestCase {
131145

132146
XCTAssertFalse(rightNav.viewControllers[0].hidesBottomBarWhenPushed)
133147
XCTAssertFalse(rightNav.viewControllers[1].hidesBottomBarWhenPushed)
134-
XCTAssertTrue(rightNav.viewControllers[2].hidesBottomBarWhenPushed)
148+
149+
// RepositoryViewController should not hide bottom bar
150+
XCTAssertTrue(!rightNav.viewControllers[2].hidesBottomBarWhenPushed)
151+
152+
// IssueViewController should not hide bottom bar
135153
XCTAssertTrue(rightNav.viewControllers[3].hidesBottomBarWhenPushed)
154+
136155
}
137156

138157
func test_whenCollapsing_withPlaceholderStackedOnDetail_thatVCsStackedWithoutPlaceholder() {

0 commit comments

Comments
 (0)