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

Tabbar hide fix #2505

Merged
merged 2 commits into from
Nov 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/View Controllers/SplitViewControllerDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class SplitViewControllerDelegate: UISplitViewControllerDelegate {
let secondaryNav = secondaryViewController as? UINavigationController {

let collapsedControllers = secondaryNav.viewControllers.filter {
$0.hidesBottomBarWhenPushed = true

// remove any placeholder VCs from the stack
return ($0 is SplitPlaceholderViewController) == false
}
Expand Down
29 changes: 26 additions & 3 deletions FreetimeTests/SplitViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,26 @@ class SplitViewTests: XCTestCase {
masterTab.selectedIndex = 1

let detailNav = UINavigationController()
let detail1 = UIViewController()
let detail2 = UIViewController()


let detail1 = RepositoryViewController(
client: GithubClient(userSession: nil),
repo: RepositoryDetails(
owner: "Foo",
name: "Bar",
defaultBranch: "Baz",
hasIssuesEnabled: false
))

let detail2 = IssuesViewController(
client: GithubClient(userSession: nil),
model: IssueDetailsModel(
owner: "Foo",
repo: "Bar",
number: 0
))


detailNav.pushViewController(detail1, animated: false)
detailNav.pushViewController(detail2, animated: false)

Expand All @@ -131,8 +149,13 @@ class SplitViewTests: XCTestCase {

XCTAssertFalse(rightNav.viewControllers[0].hidesBottomBarWhenPushed)
XCTAssertFalse(rightNav.viewControllers[1].hidesBottomBarWhenPushed)
XCTAssertTrue(rightNav.viewControllers[2].hidesBottomBarWhenPushed)

// RepositoryViewController should not hide bottom bar
XCTAssertTrue(!rightNav.viewControllers[2].hidesBottomBarWhenPushed)

// IssueViewController should not hide bottom bar
XCTAssertTrue(rightNav.viewControllers[3].hidesBottomBarWhenPushed)

}

func test_whenCollapsing_withPlaceholderStackedOnDetail_thatVCsStackedWithoutPlaceholder() {
Expand Down