Skip to content

Commit

Permalink
Merge branch 'release/0.4.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
msaps committed Feb 28, 2017
2 parents 44f065c + bcebfd3 commit a4040e6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Pageboy.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Pageboy/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.4.6</string>
<string>0.4.7</string>
<key>CFBundleVersion</key>
<string>AUTO_GENERATED</string>
<key>NSPrincipalClass</key>
Expand Down
4 changes: 2 additions & 2 deletions Sources/Pageboy/PageboyScrollDetection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -96,7 +96,7 @@ extension PageboyViewController: UIPageViewControllerDelegate, UIScrollViewDeleg
} else {
positionPoint = CGPoint(x: scrollView.contentOffset.x, y: pagePosition)
}

// ignore duplicate updates
guard self.currentPosition != positionPoint else { return }
self.currentPosition = positionPoint
Expand Down

0 comments on commit a4040e6

Please sign in to comment.