diff --git a/Bolts/iOS/BFAppLinkReturnToRefererView.m b/Bolts/iOS/BFAppLinkReturnToRefererView.m index 7ca6d25e0..d9cb2a77b 100644 --- a/Bolts/iOS/BFAppLinkReturnToRefererView.m +++ b/Bolts/iOS/BFAppLinkReturnToRefererView.m @@ -146,7 +146,7 @@ - (CGFloat)statusBarHeight { BOOL include; switch (_includeStatusBarInSize) { case BFIncludeStatusBarInSizeAlways: - include = NO; + include = YES; break; case BFIncludeStatusBarInSizeIOS7AndLater: { float systemVersion = [[[UIDevice currentDevice] systemVersion] floatValue]; diff --git a/BoltsTests/AppLinkReturnToRefererViewTests.m b/BoltsTests/AppLinkReturnToRefererViewTests.m index 9cf19ce77..6742de0e4 100644 --- a/BoltsTests/AppLinkReturnToRefererViewTests.m +++ b/BoltsTests/AppLinkReturnToRefererViewTests.m @@ -74,17 +74,30 @@ - (void)testValidRefererDataResultsInNonZeroSizeThatFits { XCTAssert(sizeThatFits.width > 0.0); } -- (void)testNotIncludingStatusBarResultsInSmallerHeight { +- (void)testIncludesStatusBarResultsInLargerHeight { NSURL *url = [NSURL URLWithString:BFURLWithRefererData]; BFAppLink *appLink = [[BFURL URLWithURL:url] appLinkReferer]; BFAppLinkReturnToRefererView *view = [[BFAppLinkReturnToRefererView alloc] init]; view.refererAppLink = appLink; + view.includeStatusBarInSize = BFIncludeStatusBarInSizeNever; + CGSize sizeThatFitsNotIncludingStatusBar = [view sizeThatFits:CGSizeMake(100.0, 100.0)]; + view.includeStatusBarInSize = BFIncludeStatusBarInSizeAlways; CGSize sizeThatFitsIncludingStatusBar = [view sizeThatFits:CGSizeMake(100.0, 100.0)]; - view.includeStatusBarInSize = BFIncludeStatusBarInSizeNever; + XCTAssert(sizeThatFitsIncludingStatusBar.height > sizeThatFitsNotIncludingStatusBar.height); +} +- (void)testNotIncludingStatusBarResultsInSmallerHeight { + NSURL *url = [NSURL URLWithString:BFURLWithRefererData]; + BFAppLink *appLink = [[BFURL URLWithURL:url] appLinkReferer]; + + BFAppLinkReturnToRefererView *view = [[BFAppLinkReturnToRefererView alloc] init]; + view.refererAppLink = appLink; + CGSize sizeThatFitsIncludingStatusBar = [view sizeThatFits:CGSizeMake(100.0, 100.0)]; + + view.includeStatusBarInSize = BFIncludeStatusBarInSizeNever; CGSize sizeThatFitsNotIncludingStatusBar = [view sizeThatFits:CGSizeMake(100.0, 100.0)]; XCTAssert(sizeThatFitsIncludingStatusBar.height > sizeThatFitsNotIncludingStatusBar.height);