Skip to content

Commit f855bb6

Browse files
committed
Add delay for subsequent animations.
1 parent 251f3e4 commit f855bb6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

iOSAnimationSample/PositionViewController.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ class PositionViewController: UIViewController {
3434

3535
UIView.animateWithDuration(1, animations: {
3636
self.blueSquare.center.x = self.view.bounds.width - self.blueSquare.center.x
37+
})
38+
39+
UIView.animateWithDuration(1, delay: 0.5, options: nil, animations: {
3740
self.redSquare.center.y = self.view.bounds.height - self.redSquare.center.y
38-
41+
}, completion: nil)
42+
43+
UIView.animateWithDuration(1, delay: 1, options: nil, animations: {
3944
self.greenSquare.center.x = self.view.bounds.width - self.greenSquare.center.x
4045
self.greenSquare.center.y = self.view.bounds.height - self.greenSquare.center.y
41-
// <_UIViewAdditiveAnimationAction: 0x7fe17b70df30>
42-
// println(self.view.actionForLayer(self.view.layer, forKey: "position"))
43-
})
46+
}, completion: nil)
4447
}
4548

4649
/*

0 commit comments

Comments
 (0)