From 62b374f1fc97993151edcb2fa410ef390077924f Mon Sep 17 00:00:00 2001 From: Merrick Sapsford Date: Tue, 28 Feb 2017 10:33:38 +0000 Subject: [PATCH 1/3] Fix issue with overscrolling - Fix issue where overscroll events would not be reported correctly. --- Sources/Pageboy/PageboyScrollDetection.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/Pageboy/PageboyScrollDetection.swift b/Sources/Pageboy/PageboyScrollDetection.swift index 1a0d92c2..f75d5620 100644 --- a/Sources/Pageboy/PageboyScrollDetection.swift +++ b/Sources/Pageboy/PageboyScrollDetection.swift @@ -69,7 +69,7 @@ extension PageboyViewController: UIPageViewControllerDelegate, UIScrollViewDeleg contentOffset = scrollView.contentOffset.y } - let scrollIndexDiff = CGFloat(abs((self.expectedTransitionIndex ?? currentIndex + 1) - currentIndex)) + let scrollIndexDiff = CGFloat(max(1, abs((self.expectedTransitionIndex ?? currentIndex + 1) - currentIndex))) let scrollOffset = contentOffset - pageSize let pageOffset = (CGFloat(currentIndex) * pageSize) + (scrollOffset * scrollIndexDiff) var pagePosition = pageOffset / pageSize @@ -97,6 +97,8 @@ extension PageboyViewController: UIPageViewControllerDelegate, UIScrollViewDeleg positionPoint = CGPoint(x: scrollView.contentOffset.x, y: pagePosition) } + print(positionPoint) + // ignore duplicate updates guard self.currentPosition != positionPoint else { return } self.currentPosition = positionPoint From 86a4f6800a436639a2fb1a8c44accd0855b8ef02 Mon Sep 17 00:00:00 2001 From: Merrick Sapsford Date: Tue, 28 Feb 2017 10:34:29 +0000 Subject: [PATCH 2/3] Remove logging --- Sources/Pageboy/PageboyScrollDetection.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/Pageboy/PageboyScrollDetection.swift b/Sources/Pageboy/PageboyScrollDetection.swift index f75d5620..b10e0b38 100644 --- a/Sources/Pageboy/PageboyScrollDetection.swift +++ b/Sources/Pageboy/PageboyScrollDetection.swift @@ -96,9 +96,7 @@ extension PageboyViewController: UIPageViewControllerDelegate, UIScrollViewDeleg } else { positionPoint = CGPoint(x: scrollView.contentOffset.x, y: pagePosition) } - - print(positionPoint) - + // ignore duplicate updates guard self.currentPosition != positionPoint else { return } self.currentPosition = positionPoint From bcebfd37bf7dfa951e1972972c4b077f314eed4b Mon Sep 17 00:00:00 2001 From: Merrick Sapsford Date: Tue, 28 Feb 2017 20:16:55 +0000 Subject: [PATCH 3/3] Update version number --- Pageboy.podspec | 2 +- Sources/Pageboy/Info.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pageboy.podspec b/Pageboy.podspec index 378cef08..a623ba8e 100644 --- a/Pageboy.podspec +++ b/Pageboy.podspec @@ -4,7 +4,7 @@ Pod::Spec.new do |s| s.platform = :ios, "9.0" s.requires_arc = true - s.version = "0.4.6" + s.version = "0.4.7" s.summary = "A simple, highly informative page view controller." s.description = <<-DESC Pageboy is a page view controller that provides simplified data source management, enhanced delegation and other useful features. diff --git a/Sources/Pageboy/Info.plist b/Sources/Pageboy/Info.plist index e3726473..d1453129 100644 --- a/Sources/Pageboy/Info.plist +++ b/Sources/Pageboy/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.4.6 + 0.4.7 CFBundleVersion AUTO_GENERATED NSPrincipalClass