Fix jump when sheet first starts moving
This commit is contained in:
parent
808d3b3157
commit
78385359e1
|
@ -154,6 +154,10 @@ open class SheetContainerViewController: UIViewController {
|
|||
if scrollViewIsMovingSheet {
|
||||
if initialScrollViewContentOffset == nil {
|
||||
initialScrollViewContentOffset = scrollView.contentOffset
|
||||
|
||||
// if the sheet begins moving part way through the gesture, we need to ignore any translation
|
||||
// that's already taken place, otherwise the sheet will jump when it starts moving
|
||||
recognizer.setTranslation(.zero, in: scrollView)
|
||||
}
|
||||
scrollView.setContentOffset(initialScrollViewContentOffset!, animated: false)
|
||||
|
||||
|
|
Loading…
Reference in New Issue