Skip to content

Commit

Permalink
Allow a slight overscroll above maximum drawer height to better emula…
Browse files Browse the repository at this point in the history
…te Apple Maps behavior. (Note: Not exact due to backwards compat concerns). #180
  • Loading branch information
amyleecodes committed Mar 16, 2018
1 parent 8951bfd commit 617bf1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Pulley.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions PulleyLib/PulleyViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 617bf1f

Please sign in to comment.