Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: rename transition animation parameter #90

Merged
merged 3 commits into from
Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "robb/Cartography" "1.0.0"
github "robb/Cartography" "1.0.1"
github "hyperoslo/Pages" "1.0.0"
2 changes: 1 addition & 1 deletion Example/Parallax/Parallax/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class ViewController: PresentationController {
for (column, backgroundImage) in backgroundImages.enumerated() {
if let position = backgroundImage.positionAt(row), let content = contents.at(column) {
addAnimation(TransitionAnimation(content: content, destination: position,
duration: 2.0, dumping: 1.0), forPage: row)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

duration: 2.0, damping: 1.0), forPage: row)
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions Example/Parallax/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PODS:
- Cartography (1.0.0)
- Cartography (1.0.1)
- Hue (1.2.0)
- Pages (1.0.0)
- Presentation (2.1.0):
- Presentation (3.0.0):
- Cartography
- Pages

Expand All @@ -19,15 +19,15 @@ EXTERNAL SOURCES:

CHECKOUT OPTIONS:
Hue:
:commit: c21ca81d4fa002309f8f8f554317bf9ec3167365
:commit: 3303cbcdf0f771aea1a6d1a153e4b95eef8696eb
:git: https://github.com/hyperoslo/Hue

SPEC CHECKSUMS:
Cartography: e576cf19c0c1f201686180bcf4537f981574ce8d
Cartography: c1460e99395b824d9d75360b0382faeb0b33dcd7
Hue: 0705083b7aff40334033373e6293ec1215285ac2
Pages: f3718e6f03a5e2787f6b0bff4becb3c7c19bcebc
Presentation: bb372ffe054c1aab90b4455f1b515f26650ccb09
Presentation: 2a7e0379ab403c0bd91c4f6d5c59480edba6f429

PODFILE CHECKSUM: f41db61a2828ca5a77fd53546b00649e4bd644cc

COCOAPODS: 1.1.0.rc.2
COCOAPODS: 1.2.0
12 changes: 6 additions & 6 deletions Example/Tutorial/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PODS:
- Cartography (1.0.0)
- Cartography (1.0.1)
- Hue (1.2.0)
- Pages (1.0.0)
- Presentation (2.1.0):
- Presentation (3.0.0):
- Cartography
- Pages

Expand All @@ -19,15 +19,15 @@ EXTERNAL SOURCES:

CHECKOUT OPTIONS:
Hue:
:commit: c21ca81d4fa002309f8f8f554317bf9ec3167365
:commit: 3303cbcdf0f771aea1a6d1a153e4b95eef8696eb
:git: https://github.com/hyperoslo/Hue

SPEC CHECKSUMS:
Cartography: e576cf19c0c1f201686180bcf4537f981574ce8d
Cartography: c1460e99395b824d9d75360b0382faeb0b33dcd7
Hue: 0705083b7aff40334033373e6293ec1215285ac2
Pages: f3718e6f03a5e2787f6b0bff4becb3c7c19bcebc
Presentation: bb372ffe054c1aab90b4455f1b515f26650ccb09
Presentation: 2a7e0379ab403c0bd91c4f6d5c59480edba6f429

PODFILE CHECKSUM: a46ef067438fe85dbabc3ca50d68bda71f1ff526

COCOAPODS: 1.1.0.rc.2
COCOAPODS: 1.2.0
2 changes: 2 additions & 0 deletions Example/Tutorial/Tutorial.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Tutorial;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 2;
};
name = Debug;
};
Expand All @@ -346,6 +347,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Tutorial;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 2;
};
name = Release;
};
Expand Down
8 changes: 4 additions & 4 deletions Source/Animations/TransitionAnimation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class TransitionAnimation: NSObject, Animatable {
let content: Content
let destination: Position
let duration: TimeInterval
let dumping: CGFloat
let damping: CGFloat
var reflective: Bool
var initial: Bool
var played = false
Expand All @@ -19,11 +19,11 @@ public class TransitionAnimation: NSObject, Animatable {
}()

public init(content: Content, destination: Position,
duration: TimeInterval = 1.0, dumping: CGFloat = 0.7, reflective: Bool = false, initial: Bool = false) {
duration: TimeInterval = 1.0, damping: CGFloat = 0.7, reflective: Bool = false, initial: Bool = false) {
self.content = content
self.destination = destination
self.duration = duration
self.dumping = dumping
self.damping = damping
self.reflective = reflective
self.initial = initial

Expand All @@ -33,7 +33,7 @@ public class TransitionAnimation: NSObject, Animatable {
fileprivate func animate(to position: Position) {
UIView.animate(withDuration: duration,
delay: 0,
usingSpringWithDamping: dumping,
usingSpringWithDamping: damping,
initialSpringVelocity: 0.5,
options: [.beginFromCurrentState, .allowUserInteraction],
animations: { [unowned self] in
Expand Down
2 changes: 1 addition & 1 deletion Source/Content.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ extension Content {
content: content,
destination: Position(left: 0.5, bottom: content.initialPosition.bottom),
duration: 2.0,
dumping: 0.8,
damping: 0.8,
reflective: true)
}
}