Skip to content

Commit

Permalink
Merge pull request #71 from AlexZd/master
Browse files Browse the repository at this point in the history
fix nan position
  • Loading branch information
msaps authored Jun 14, 2017
2 parents add0fdb + 125b964 commit 2da3fbe
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ extension PageboyViewController: UIPageViewControllerDelegate, UIScrollViewDeleg

let scrollOffset = contentOffset - pageSize
let pageOffset = (CGFloat(currentIndex) * pageSize) + (scrollOffset * indexDiff)
return pageOffset / pageSize
let position = pageOffset / pageSize
return position.isFinite ? position : 0
}

/// Update the scroll view contentOffset for bouncing preference if required.
Expand Down

0 comments on commit 2da3fbe

Please sign in to comment.