Skip to content

Commit

Permalink
Fixed crash on tap on status bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
BohdanOrlov committed Jul 30, 2018
1 parent ebcf0e6 commit 2b3a561
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion BouncyPageViewController.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Pod::Spec.new do |s|
s.name = 'BouncyPageViewController'
s.version = '0.1.0'
s.version = '0.1.1'
s.summary = 'Page view controller with bounce effect'


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ public class BouncyPageViewController: UIViewController, UIScrollViewDelegate {
private(set) var viewControllers: [UIViewController?]!

//MARK: - On Did Scroll

public func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool {
return false
}

public func scrollViewDidScroll(_ scrollView: UIScrollView) {
self.shiftViewControllerIfNeeded()
self.resetScrollViewContentOffsetIfNeeded()
Expand All @@ -106,7 +111,7 @@ public class BouncyPageViewController: UIViewController, UIScrollViewDelegate {
let offset = self.contentOffset() - self.baseOffset()
self.didScroll?(self, offset, abs(offset) / self.pageSize().height)
}

private func shiftViewControllerIfNeeded() {
if self.scrolledToNextPage() {
if let removedVC = self.viewControllers.removeFirst() {
Expand Down Expand Up @@ -313,4 +318,4 @@ public class BouncyPageViewController: UIViewController, UIScrollViewDelegate {
private func maxNumberOfPages() -> Int {
return self.numberOfVisiblePages() + 2
}
}
}
15 changes: 13 additions & 2 deletions Example/BouncyPageViewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-BouncyPageViewController_Example-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
4345708AB55E63620E3D4D0F /* [CP] Embed Pods Frameworks */ = {
Expand All @@ -307,13 +310,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-BouncyPageViewController_Tests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
B43DDFCDEB7A6249DAB3979E /* [CP] Copy Pods Resources */ = {
Expand Down Expand Up @@ -352,9 +358,14 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-BouncyPageViewController_Example/Pods-BouncyPageViewController_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/BouncyPageViewController/BouncyPageViewController.framework",
"${BUILT_PRODUCTS_DIR}/RBBAnimation/RBBAnimation.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BouncyPageViewController.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RBBAnimation.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ DEPENDENCIES:

EXTERNAL SOURCES:
BouncyPageViewController:
:path: "../"
:path: ../

SPEC CHECKSUMS:
BouncyPageViewController: 74a3511a449907d40506c2e710d1a2377cfd5770
BouncyPageViewController: 46bf89606cda77a566faf987fbe1ef1436442892
RBBAnimation: 4b2d66f6d993febce63cd564da934985313b9c59

PODFILE CHECKSUM: 1730e0eec1412d843841bceaeac4f59eb94926cc

COCOAPODS: 1.1.0.rc.2
COCOAPODS: 1.4.0

0 comments on commit 2b3a561

Please sign in to comment.