Skip to content

Commit

Permalink
Merge branch 'release/2.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
msaps committed Apr 23, 2018
2 parents 4dd56a2 + 759e2a8 commit fc2b122
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file.
`Pageboy` adheres to [Semantic Versioning](http://semver.org/).

#### 2.x Releases
- `2.5.x` Releases - [2.5.0](#250)
- `2.5.x` Releases - [2.5.0](#250) | [2.5.1](#251)
- `2.4.x` Releases - [2.4.0](#240)
- `2.3.x` Releases - [2.3.0](#230) | [2.3.1](#231) | [2.3.2](#232) | [2.3.3](#233) | [2.3.4](#234)
- `2.2.x` Releases - [2.2.0](#220)
Expand All @@ -22,6 +22,13 @@ All notable changes to this project will be documented in this file.

---

## [2.5.1](https://github.com/uias/Pageboy/releases/tag/2.5.1)
Released on 2018-04-23

#### Fixed
- [#159](https://github.com/uias/Pageboy/issues/159) Current Index is negative when infinite scroll is enabled and scrolling between ranges.
- by [msaps](https://github.com/msaps).

## [2.5.0](https://github.com/uias/Pageboy/releases/tag/2.5.0)
Released on 2018-04-05

Expand Down
2 changes: 1 addition & 1 deletion Pageboy.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Pod::Spec.new do |s|

s.requires_arc = true

s.version = "2.5.0"
s.version = "2.5.1"
s.summary = "A simple, highly informative page view controller."
s.description = <<-DESC
A page view controller that provides simplified data source management, enhanced delegation and other useful features.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,7 @@ private extension PageboyViewController {
currentIndex = Int(pagePosition)
}

guard currentIndex != self.currentIndex else {
return false
}
self.currentIndex = currentIndex
return updateCurrentPageIndexIfNeeded(currentIndex)
}

return false
Expand All @@ -302,12 +299,15 @@ private extension PageboyViewController {
/// Safely update the current page index.
///
/// - Parameter index: the proposed index.
private func updateCurrentPageIndexIfNeeded(_ index: Int) {
/// - Returns: Whether the page index was updated.
@discardableResult
private func updateCurrentPageIndexIfNeeded(_ index: Int) -> Bool {
guard self.currentIndex != index, index >= 0 &&
index < self.viewControllerCount ?? 0 else {
return
return false
}
self.currentIndex = index
return true
}

/// Calculate the expected index diff for a page scroll.
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>2.5.0</string>
<string>2.5.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down

0 comments on commit fc2b122

Please sign in to comment.