hide tab bar when collapsing on some VCs, fixes #296

This commit is contained in:
Ryan Nystrom
2017-09-10 16:10:44 -04:00
parent 7bec0c4288
commit d6219f05e3
3 changed files with 8 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ final class SplitViewControllerDelegate: UISplitViewControllerDelegate {
// remove any placeholder VCs from the stack
primaryNav.viewControllers += secondaryNav.viewControllers.filter {
$0.hidesBottomBarWhenPushed = true
return ($0 is SplitPlaceholderViewController) == false
}
}

View File

@@ -24,6 +24,7 @@ class SplitViewTests: XCTestCase {
let right2 = RootViewController()
let right3 = UIViewController()
let right4 = UIViewController()
right2.hidesBottomBarWhenPushed = true
rightNav.pushViewController(right1, animated: false)
rightNav.pushViewController(right2, animated: false)
rightNav.pushViewController(right3, animated: false)
@@ -126,6 +127,11 @@ class SplitViewTests: XCTestCase {
XCTAssertEqual(rightNav.viewControllers[1], right2)
XCTAssertEqual(rightNav.viewControllers[2], detail1)
XCTAssertEqual(rightNav.viewControllers[3], detail2)
XCTAssertFalse(rightNav.viewControllers[0].hidesBottomBarWhenPushed)
XCTAssertFalse(rightNav.viewControllers[1].hidesBottomBarWhenPushed)
XCTAssertTrue(rightNav.viewControllers[2].hidesBottomBarWhenPushed)
XCTAssertTrue(rightNav.viewControllers[3].hidesBottomBarWhenPushed)
}
func test_whenCollapsing_withPlaceholderStackedOnDetail_thatVCsStackedWithoutPlaceholder() {

View File

@@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1743</string>
<string>1748</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>