Fix sheet starting to move before content is scrolled up all the way

This commit is contained in:
Shadowfacts 2020-01-04 14:35:07 -05:00
parent 03d0556947
commit 808d3b3157
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 1 additions and 1 deletions

View File

@ -136,7 +136,7 @@ open class SheetContainerViewController: UIViewController {
let velocity = recognizer.velocity(in: scrollView)
let topContentOffset: CGFloat = delegate?.sheetContainer(self, topContentOffsetForScrollView: scrollView) ?? 0
let shouldMoveSheetDown = scrollView.contentOffset.y <= topContentOffset && velocity.y > 0 // scrolled to top and dragging down
let shouldMoveSheetDown = scrollView.contentOffset.y <= -topContentOffset && velocity.y > 0 // scrolled to top and dragging down
let shouldMoveSheetUp = topConstraint.constant > topDetent.offset && velocity.y < 0 // not fully expanded and dragging up
let shouldMoveSheet = shouldMoveSheetDown || shouldMoveSheetUp