From 617bf1f5d719b9636f36ab845ff932fc9ad20372 Mon Sep 17 00:00:00 2001 From: Brendan Lee Date: Thu, 15 Mar 2018 21:45:07 -0400 Subject: [PATCH] Allow a slight overscroll above maximum drawer height to better emulate Apple Maps behavior. (Note: Not exact due to backwards compat concerns). #180 --- Pulley.podspec | 2 +- PulleyLib/PulleyViewController.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Pulley.podspec b/Pulley.podspec index c707e9e..c65f718 100644 --- a/Pulley.podspec +++ b/Pulley.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'Pulley' - s.version = '2.2.9' + s.version = '2.3.0' s.summary = 'A library to imitate the iOS 10 Maps UI.' # This description is used to generate tags and improve search results. diff --git a/PulleyLib/PulleyViewController.swift b/PulleyLib/PulleyViewController.swift index fb9387a..d274982 100755 --- a/PulleyLib/PulleyViewController.swift +++ b/PulleyLib/PulleyViewController.swift @@ -725,7 +725,7 @@ open class PulleyViewController: UIViewController, PulleyDrawerViewControllerDel drawerContentContainer.frame = CGRect(x: 0, y: drawerScrollView.bounds.height - lowestStop, width: drawerScrollView.bounds.width, height: drawerScrollView.bounds.height + bounceOverflowMargin) drawerBackgroundVisualEffectView?.frame = drawerContentContainer.frame drawerShadowView.frame = drawerContentContainer.frame - drawerScrollView.contentSize = CGSize(width: drawerScrollView.bounds.width, height: (drawerScrollView.bounds.height - lowestStop) + drawerScrollView.bounds.height - safeAreaBottomInset) + drawerScrollView.contentSize = CGSize(width: drawerScrollView.bounds.width, height: (drawerScrollView.bounds.height - lowestStop) + drawerScrollView.bounds.height - safeAreaBottomInset + (bounceOverflowMargin - 5.0)) // Update rounding mask and shadows let borderPath = UIBezierPath(roundedRect: drawerContentContainer.bounds, byRoundingCorners: [.topLeft, .topRight], cornerRadii: CGSize(width: drawerCornerRadius, height: drawerCornerRadius)).cgPath @@ -1499,7 +1499,7 @@ extension PulleyViewController: UIScrollViewDelegate { let lowestStop = drawerStops.min() ?? 0 - if (scrollView.contentOffset.y - getBottomSafeArea()) > partialRevealHeight - lowestStop + if (scrollView.contentOffset.y - getBottomSafeArea()) > partialRevealHeight - lowestStop && supportedPositions.contains(.open) { // Calculate percentage between partial and full reveal let fullRevealHeight = (self.drawerScrollView.bounds.height)