Skip to content

Commit

Permalink
Merge pull request #73 from hyperoslo/fix/content-animation
Browse files Browse the repository at this point in the history
Fix slide views animation
  • Loading branch information
vadymmarkov committed Oct 6, 2015
2 parents 96dddea + 75bf513 commit 29e43b0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Example/Parallax/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PODS:
- Hex (2.0)
- Pages (0.6.2)
- Presentation (2.0.0):
- Cartography (~> 0.6.0)
- Cartography
- Pages (~> 0.6.2)

DEPENDENCIES:
Expand All @@ -26,6 +26,6 @@ SPEC CHECKSUMS:
Cartography: 70af183a248547694a8cfaa6b989cb7e04589985
Hex: 1800bd20206b93b10422d2289baa3787698825ad
Pages: 6c042132f8c63c34d242789b7763d4c64e9681a0
Presentation: 156bb732160bc092e3a288aa2c43a808a9a2d627
Presentation: ffc0ebd6775cf66071dc1b151848a67637cc8c05

COCOAPODS: 0.39.0.beta.5
8 changes: 4 additions & 4 deletions Example/Tutorial/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PODS:
- Hex (2.0)
- Pages (0.6.2)
- Presentation (2.0.0):
- Cartography (~> 0.6.0)
- Cartography
- Pages (~> 0.6.2)

DEPENDENCIES:
Expand All @@ -15,7 +15,7 @@ EXTERNAL SOURCES:
Pages:
:git: https://github.com/hyperoslo/Pages
Presentation:
:path: "../../"
:path: ../../

CHECKOUT OPTIONS:
Pages:
Expand All @@ -26,6 +26,6 @@ SPEC CHECKSUMS:
Cartography: 70af183a248547694a8cfaa6b989cb7e04589985
Hex: 1800bd20206b93b10422d2289baa3787698825ad
Pages: 6c042132f8c63c34d242789b7763d4c64e9681a0
Presentation: 156bb732160bc092e3a288aa2c43a808a9a2d627
Presentation: ffc0ebd6775cf66071dc1b151848a67637cc8c05

COCOAPODS: 0.39.0.beta.4
COCOAPODS: 0.39.0.beta.5
6 changes: 4 additions & 2 deletions Source/Animations/TransitionAnimation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public class TransitionAnimation: NSObject, Animatable {
delay: 0,
usingSpringWithDamping: dumping,
initialSpringVelocity: 0.5,
options: [.BeginFromCurrentState, .AllowUserInteraction, .LayoutSubviews],
options: [.BeginFromCurrentState, .AllowUserInteraction],
animations: { [unowned self] in
self.content.position = position
self.content.view.superview!.layoutIfNeeded()
self.content.animate()
}, completion: nil)

played = true
Expand All @@ -55,6 +55,8 @@ extension TransitionAnimation {
let position = reflective ? startMirror : start

content.position = position
content.animate()

animateTo(destination)
}
}
Expand Down
4 changes: 4 additions & 0 deletions Source/Content.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public class Content: NSObject {
view.layoutIfNeeded()
}
}

public func animate() {
view.superview!.layoutIfNeeded()
}
}

extension Content {
Expand Down

0 comments on commit 29e43b0

Please sign in to comment.