From c3144f60fc87511a558b98fa250e473679eaf84e Mon Sep 17 00:00:00 2001 From: Jason Wolkovitz Date: Thu, 1 Nov 2018 19:01:45 -0400 Subject: [PATCH] fixed Scrolling views that don't take up the entire screen Scroll up but don't come down #354 --- Source/ScrollingNavbar+Sizes.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/ScrollingNavbar+Sizes.swift b/Source/ScrollingNavbar+Sizes.swift index cc87f063..1a2cabcf 100644 --- a/Source/ScrollingNavbar+Sizes.swift +++ b/Source/ScrollingNavbar+Sizes.swift @@ -27,7 +27,14 @@ extension ScrollingNavigationController { // Extended status call changes the bounds of the presented view var extendedStatusBarDifference: CGFloat { - return abs(view.bounds.height - (UIApplication.shared.delegate?.window??.frame.size.height ?? UIScreen.main.bounds.height)) + var appHeight = view.bounds.height + var nextView = view + while let superView = nextView?.superview { + appHeight = superView.bounds.height + nextView = superView.superview + } + + return abs(appHeight - (UIApplication.shared.delegate?.window??.frame.size.height ?? UIScreen.main.bounds.height)) } var tabBarOffset: CGFloat {