Skip to content

Commit

Permalink
Merge branch 'release/2.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
msaps committed Oct 22, 2017
2 parents 5f6027d + 62c1d34 commit 8b54035
Show file tree
Hide file tree
Showing 18 changed files with 109 additions and 56 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
/fastlane/README.md
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode8.2
osx_image: xcode9
before_install:
- gem update fastlane --no-ri --no-rdoc --no-document
- git remote set-url origin "https://${GITHUB_TOKEN}@github.com/uias/Pageboy.git"
Expand Down
6 changes: 4 additions & 2 deletions .travis/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

fastlane test
if [ "${TRAVIS_BRANCH}" = "master" ] && [ -n "${TRAVIS_TAG}" ]; then
fastlane deploy
fi
else
fastlane test
fi
exit
Binary file modified Artwork/artwork.sketch
Binary file not shown.
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.0.x` Releases - [2.0.0](#200)
- `2.0.x` Releases - [2.0.0](#200) | [2.0.1](#201)

#### 1.x Releases
- `1.4.x` Releases - [1.4.0](#140) | [1.4.1](#141)
Expand All @@ -17,6 +17,13 @@ All notable changes to this project will be documented in this file.

---

## [2.0.1](https://github.com/uias/Pageboy/releases/tag/2.0.1)
Released on 2017-10-22

#### Fixed
- [#109](https://github.com/uias/Pageboy/issues/109) UIPageViewController crash with intense scrolling input.
- by [msaps](https://github.com/msaps).

## [2.0.0](https://github.com/uias/Pageboy/releases/tag/2.0.0)
Released on 2017-09-13

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 2 additions & 7 deletions Example/Pageboy-Example/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
<array key="Avenir.ttc">
<string>Avenir-Light</string>
</array>
</customFonts>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
Expand All @@ -27,8 +22,8 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Pageboy" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0i6-er-RTZ">
<rect key="frame" x="117" y="309.5" width="141.5" height="49.5"/>
<fontDescription key="fontDescription" name="Avenir-Light" family="Avenir" pointSize="36"/>
<rect key="frame" x="110" y="309" width="156.5" height="50.5"/>
<fontDescription key="fontDescription" type="system" pointSize="42"/>
<color key="textColor" red="0.082352941176470587" green="0.53333333333333333" blue="0.78823529411764703" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
Expand Down
2 changes: 1 addition & 1 deletion Pageboy.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Pod::Spec.new do |s|

s.requires_arc = true

s.version = "2.0.0"
s.version = "2.0.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
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.0.0</string>
<string>2.0.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
20 changes: 10 additions & 10 deletions Sources/Pageboy/PageboyViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,16 @@ open class PageboyViewController: UIViewController {
with: direction,
animated: animated,
completion: transitionCompletion)
self.pageViewController?.setViewControllers([viewController],
direction: direction.pageViewControllerNavDirection,
animated: false,
completion:
{ (finished) in
guard animated == false else { return }
transitionCompletion(finished)
})

DispatchQueue.main.async {
self.pageViewController?.setViewControllers([viewController],
direction: direction.pageViewControllerNavDirection,
animated: false,
completion:
{ (finished) in
guard animated == false else { return }
transitionCompletion(finished)
})
}
return true

} else {
Expand All @@ -388,5 +389,4 @@ open class PageboyViewController: UIViewController {
return false
}
}

}
16 changes: 10 additions & 6 deletions Sources/PageboyTests/PageboyPropertyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ class PageboyPropertyTests: PageboyTests {
self.dataSource.numberOfPages = 5
self.pageboyViewController.dataSource = self.dataSource

self.pageboyViewController.scrollToPage(.next, animated: false)

let currentViewController = self.pageboyViewController.currentViewController

XCTAssertTrue(currentViewController === self.dataSource.viewControllers?[1],
"currentViewController property is incorrect following transitions.")
performAsyncTest { (completion) in

self.pageboyViewController.scrollToPage(.next, animated: false) { (newViewController, animated, finished) in
let currentViewController = self.pageboyViewController.currentViewController

XCTAssertTrue(currentViewController === self.dataSource.viewControllers?[1],
"currentViewController property is incorrect following transitions.")
completion()
}
}
}

/// Test that setting isScrollEnabled updates internal scroll view correctly.
Expand Down
33 changes: 26 additions & 7 deletions Sources/PageboyTests/PageboyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ import XCTest

class PageboyTests: XCTestCase {

typealias AsyncTest = (@escaping TestCompletion) -> Void
typealias TestCompletion = () -> Void

var pageboyViewController: TestPageBoyViewController!
var dataSource: TestPageboyDataSource!
var delegate: TestPageboyDelegate!

//
private var expectations = [XCTestExpectation]()

// MARK: Environment
//

override func setUp() {
super.setUp()
Expand All @@ -40,19 +43,35 @@ class PageboyTests: XCTestCase {

override func tearDown() {

self.pageboyViewController = nil
self.dataSource = nil
self.delegate = nil
// self.pageboyViewController = nil
// self.dataSource = nil
// self.delegate = nil

super.tearDown()
}

//
// MARK: Tests
//

private func testInit() {
XCTAssert(self.pageboyViewController != nil,
"PageBoyViewController initialization failed")
}

func performAsyncTest(timeout: TimeInterval = 0.3,
test: AsyncTest) {
let exp = expectation(description: "Async test")
let index = expectations.count
expectations.append(exp)
test { [unowned self] in
exp.fulfill()
self.expectations.remove(at: index)
}
waitForExpectations(timeout: timeout) { (error) in
guard let error = error else {
return
}

XCTFail("Expectation failed with \(error)")
}
}
}
58 changes: 41 additions & 17 deletions Sources/PageboyTests/PageboyTransitionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ class PageboyTransitionTests: PageboyTests {
self.pageboyViewController.dataSource = self.dataSource
let transitionIndex = 2

self.pageboyViewController.scrollToPage(.at(index: transitionIndex), animated: false)

XCTAssert(self.pageboyViewController.currentIndex == transitionIndex,
"Not transitioning to valid custom index correctly (Non animated).")
performAsyncTest { (completion) in
self.pageboyViewController.scrollToPage(.at(index: transitionIndex),
animated: false)
{ (newViewController, animated, finished) in
XCTAssert(self.pageboyViewController.currentIndex == transitionIndex,
"Not transitioning to valid custom index correctly (Non animated).")
completion()
}
}
}

/// Test attempting transition to an out of bounds custom PageIndex
Expand Down Expand Up @@ -51,33 +56,52 @@ class PageboyTransitionTests: PageboyTests {
self.dataSource.numberOfPages = 5
self.pageboyViewController.dataSource = self.dataSource

self.pageboyViewController.scrollToPage(.last, animated: false)

XCTAssert(self.pageboyViewController.currentIndex == 4,
"Not transitioning to last index correctly.")
performAsyncTest { (completion) in
self.pageboyViewController.scrollToPage(.last,
animated: false)
{ (newViewController, animated, finished) in
XCTAssert(self.pageboyViewController.currentIndex == 4,
"Not transitioning to last index correctly.")
completion()
}
}
}

/// Test transition to a .next PageIndex
func testSuccessfulTransitionToNextIndex() {
self.dataSource.numberOfPages = 5
self.pageboyViewController.dataSource = self.dataSource

self.pageboyViewController.scrollToPage(.next, animated: false)

XCTAssert(self.pageboyViewController.currentIndex == 1,
"Not transitioning to next index correctly.")
performAsyncTest { (completion) in
self.pageboyViewController.scrollToPage(.next,
animated: false)
{ (newViewController, animated, finished) in
XCTAssert(self.pageboyViewController.currentIndex == 1,
"Not transitioning to next index correctly.")
completion()
}
}
}

/// Test transition to a .previous PageIndex
func testSuccessfulTransitionToPreviousIndex() {
self.dataSource.numberOfPages = 5
self.pageboyViewController.dataSource = self.dataSource

self.pageboyViewController.scrollToPage(.last, animated: false)
self.pageboyViewController.scrollToPage(.previous, animated: false)

XCTAssert(self.pageboyViewController.currentIndex == 3,
"Not transitioning to previous index correctly.")
performAsyncTest { (completion) in

self.pageboyViewController.scrollToPage(.last,
animated: false)
{ (newViewController, animated, finished) in
self.pageboyViewController.scrollToPage(.previous,
animated: false)
{ (newViewController, animated, finished) in
XCTAssert(self.pageboyViewController.currentIndex == 3,
"Not transitioning to previous index correctly.")
completion()
}
}
}
}

/// Test partial user interacted transition reports offsets correctly.
Expand Down
7 changes: 4 additions & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ platform :ios do

desc "Run unit tests and check library"
lane :test do
scan(workspace: "Pageboy.xcworkspace", scheme: "Pageboy", clean: true)
pod_lib_lint(verbose: true)
scan(workspace: "Pageboy.xcworkspace", scheme: "Pageboy iOS", clean: true)
pod_lib_lint
end

desc "Deploy a new version to CocoaPods and GitHub"
lane :deploy do

test

podspec = "Pageboy.podspec"
version = version_get_podspec(path: podspec)

Expand Down

0 comments on commit 8b54035

Please sign in to comment.