Skip to content

Commit 29e43b0

Browse files
committed
Merge pull request #73 from hyperoslo/fix/content-animation
Fix slide views animation
2 parents 96dddea + 75bf513 commit 29e43b0

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

Example/Parallax/Podfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ PODS:
33
- Hex (2.0)
44
- Pages (0.6.2)
55
- Presentation (2.0.0):
6-
- Cartography (~> 0.6.0)
6+
- Cartography
77
- Pages (~> 0.6.2)
88

99
DEPENDENCIES:
@@ -26,6 +26,6 @@ SPEC CHECKSUMS:
2626
Cartography: 70af183a248547694a8cfaa6b989cb7e04589985
2727
Hex: 1800bd20206b93b10422d2289baa3787698825ad
2828
Pages: 6c042132f8c63c34d242789b7763d4c64e9681a0
29-
Presentation: 156bb732160bc092e3a288aa2c43a808a9a2d627
29+
Presentation: ffc0ebd6775cf66071dc1b151848a67637cc8c05
3030

3131
COCOAPODS: 0.39.0.beta.5

Example/Tutorial/Podfile.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ PODS:
33
- Hex (2.0)
44
- Pages (0.6.2)
55
- Presentation (2.0.0):
6-
- Cartography (~> 0.6.0)
6+
- Cartography
77
- Pages (~> 0.6.2)
88

99
DEPENDENCIES:
@@ -15,7 +15,7 @@ EXTERNAL SOURCES:
1515
Pages:
1616
:git: https://github.com/hyperoslo/Pages
1717
Presentation:
18-
:path: "../../"
18+
:path: ../../
1919

2020
CHECKOUT OPTIONS:
2121
Pages:
@@ -26,6 +26,6 @@ SPEC CHECKSUMS:
2626
Cartography: 70af183a248547694a8cfaa6b989cb7e04589985
2727
Hex: 1800bd20206b93b10422d2289baa3787698825ad
2828
Pages: 6c042132f8c63c34d242789b7763d4c64e9681a0
29-
Presentation: 156bb732160bc092e3a288aa2c43a808a9a2d627
29+
Presentation: ffc0ebd6775cf66071dc1b151848a67637cc8c05
3030

31-
COCOAPODS: 0.39.0.beta.4
31+
COCOAPODS: 0.39.0.beta.5

Source/Animations/TransitionAnimation.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ public class TransitionAnimation: NSObject, Animatable {
3535
delay: 0,
3636
usingSpringWithDamping: dumping,
3737
initialSpringVelocity: 0.5,
38-
options: [.BeginFromCurrentState, .AllowUserInteraction, .LayoutSubviews],
38+
options: [.BeginFromCurrentState, .AllowUserInteraction],
3939
animations: { [unowned self] in
4040
self.content.position = position
41-
self.content.view.superview!.layoutIfNeeded()
41+
self.content.animate()
4242
}, completion: nil)
4343

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

5757
content.position = position
58+
content.animate()
59+
5860
animateTo(destination)
5961
}
6062
}

Source/Content.swift

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public class Content: NSObject {
4747
view.layoutIfNeeded()
4848
}
4949
}
50+
51+
public func animate() {
52+
view.superview!.layoutIfNeeded()
53+
}
5054
}
5155

5256
extension Content {

0 commit comments

Comments
 (0)