Fix sheet starting to move before content is scrolled up all the way
This commit is contained in:
parent
03d0556947
commit
808d3b3157
|
@ -136,7 +136,7 @@ open class SheetContainerViewController: UIViewController {
|
||||||
let velocity = recognizer.velocity(in: scrollView)
|
let velocity = recognizer.velocity(in: scrollView)
|
||||||
|
|
||||||
let topContentOffset: CGFloat = delegate?.sheetContainer(self, topContentOffsetForScrollView: scrollView) ?? 0
|
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 shouldMoveSheetUp = topConstraint.constant > topDetent.offset && velocity.y < 0 // not fully expanded and dragging up
|
||||||
|
|
||||||
let shouldMoveSheet = shouldMoveSheetDown || shouldMoveSheetUp
|
let shouldMoveSheet = shouldMoveSheetDown || shouldMoveSheetUp
|
||||||
|
|
Loading…
Reference in New Issue