Allow scroll view to bounce while scrolled all the way down

This commit is contained in:
Shadowfacts 2020-01-04 14:37:16 -05:00
parent 78385359e1
commit 6ee1ad24ec
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 2 additions and 2 deletions

View File

@ -143,9 +143,9 @@ open class SheetContainerViewController: UIViewController {
switch recognizer.state { switch recognizer.state {
case .began: case .began:
scrollView.bounces = false
scrollViewIsMovingSheet = shouldMoveSheet scrollViewIsMovingSheet = shouldMoveSheet
if shouldMoveSheet { if shouldMoveSheet {
scrollView.bounces = false
initialScrollViewContentOffset = scrollView.contentOffset initialScrollViewContentOffset = scrollView.contentOffset
} }
@ -167,8 +167,8 @@ open class SheetContainerViewController: UIViewController {
} }
case .ended: case .ended:
scrollView.bounces = true
if scrollViewIsMovingSheet { if scrollViewIsMovingSheet {
scrollView.bounces = true
scrollView.setContentOffset(initialScrollViewContentOffset!, animated: false) scrollView.setContentOffset(initialScrollViewContentOffset!, animated: false)
springToNearestDetent(verticalVelocity: velocity.y) springToNearestDetent(verticalVelocity: velocity.y)
} }