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 {
case .began:
scrollView.bounces = false
scrollViewIsMovingSheet = shouldMoveSheet
if shouldMoveSheet {
scrollView.bounces = false
initialScrollViewContentOffset = scrollView.contentOffset
}
@ -167,8 +167,8 @@ open class SheetContainerViewController: UIViewController {
}
case .ended:
scrollView.bounces = true
if scrollViewIsMovingSheet {
scrollView.bounces = true
scrollView.setContentOffset(initialScrollViewContentOffset!, animated: false)
springToNearestDetent(verticalVelocity: velocity.y)
}