Skip to content

Commit 7ff9ed7

Browse files
author
pera
authored
Merge pull request xmartlabs#360 from kurebio/fix-scroll-direction
fix to always update lastContentOffset when scrolling
2 parents 7849d0c + ccb76e2 commit 7ff9ed7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/PagerTabStripViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,13 @@ open class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
305305
open func scrollViewDidScroll(_ scrollView: UIScrollView) {
306306
if containerView == scrollView {
307307
updateContent()
308+
lastContentOffset = scrollView.contentOffset.x
308309
}
309310
}
310311

311312
open func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
312313
if containerView == scrollView {
313314
lastPageNumber = pageFor(contentOffset: scrollView.contentOffset.x)
314-
lastContentOffset = scrollView.contentOffset.x
315315
}
316316
}
317317

0 commit comments

Comments
 (0)