Skip to content

Commit

Permalink
Merge branch 'release/1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
msaps committed Jun 14, 2017
2 parents fa5be61 + 3df7250 commit 154d62b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Example/Pageboy-Example/PageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class PageViewController: PageboyViewController, PageboyViewControllerDataSource
}

func updateStatusLabels() {
self.offsetLabel.text = "Current Position: " + String(format: "%.3f", self.currentPosition?.x ?? 0.0)
let offsetValue = navigationOrientation.rawValue == 0 ? self.currentPosition?.x : self.currentPosition?.y
self.offsetLabel.text = "Current Position: " + String(format: "%.3f", offsetValue ?? 0.0)
self.pageLabel.text = "Current Page: " + String(describing: self.currentIndex ?? 0)
}

Expand Down Expand Up @@ -119,7 +120,8 @@ class PageViewController: PageboyViewController, PageboyViewControllerDataSource
direction: PageboyViewController.NavigationDirection,
animated: Bool) {

self.updateAppearance(pageOffset: position.x)
let isVertical = navigationOrientation == .vertical
self.updateAppearance(pageOffset: isVertical ? position.y : position.x)
self.updateStatusLabels()

self.updateBarButtonStates(index: pageboyViewController.currentIndex ?? 0)
Expand Down
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 = "1.1.1"
s.version = "1.1.2"
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 @@ -17,7 +17,9 @@ internal extension PageboyViewController {
///
/// - Parameter reloadViewControllers: Reload the view controllers data source for the PageboyViewController.
internal func setUpPageViewController(reloadViewControllers: Bool = true) {
var existingZIndex: Int?
if self.pageViewController != nil { // destroy existing page VC
existingZIndex = self.view.subviews.index(of: self.pageViewController!.view)
self.pageViewController?.view.removeFromSuperview()
self.pageViewController?.removeFromParentViewController()
self.pageViewController = nil
Expand All @@ -33,8 +35,12 @@ internal extension PageboyViewController {
self.addChildViewController(pageViewController)
self.view.addSubview(pageViewController.view)
pageViewController.view.pinToSuperviewEdges()
self.view.sendSubview(toBack: pageViewController.view)
pageViewController.didMove(toParentViewController: self)

if let existingZIndex = existingZIndex {
self.view.insertSubview(pageViewController.view, at: existingZIndex)
} else {
self.view.addSubview(pageViewController.view)
}

pageViewController.scrollView?.delegate = self
pageViewController.view.backgroundColor = .clear
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>1.1.1</string>
<string>1.1.2</string>
<key>CFBundleVersion</key>
<string>AUTO_GENERATED</string>
<key>NSPrincipalClass</key>
Expand Down
4 changes: 2 additions & 2 deletions Sources/Pageboy/Utilities/TransitionOperation+Action.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ internal extension TransitionOperation.Action {
switch direction {

case .reverse:
return kCATransitionFromTop
default:
return kCATransitionFromBottom
default:
return kCATransitionFromTop
}
}
}
Expand Down

0 comments on commit 154d62b

Please sign in to comment.