Commit 6a61c045 authored by toby's avatar toby

better block removal animation, attempted slide

parent df9a56f7
......@@ -107,6 +107,7 @@ class ViewController: UIViewController {
case (.MotionShake):
blocks.map(removeBlock)
barriers.map({barrier in barrier.animateBackground(randomColor(), duration: 0.5)})
// barriers.map(horizontalSlide)
default:
break
}
......@@ -157,8 +158,9 @@ class ViewController: UIViewController {
delay: 0.0,
options: UIViewAnimationOptions.CurveLinear,
animations: {
block.bounds.size.width = block.bounds.size.width + (block.bounds.size.width * 0.1)
block.bounds.size.height = block.bounds.size.height + (block.bounds.size.height * 0.1)
block.bounds.size.width = block.bounds.size.width * 2
block.bounds.size.height = block.bounds.size.height * 2
block.alpha = 0.0
},
completion: {
(finished: Bool) -> Void in
......@@ -168,6 +170,19 @@ class ViewController: UIViewController {
})
}
private func horizontalSlide(view: UIView) {
UIView.animateWithDuration(
0.5,
delay: 0.0,
options: UIViewAnimationOptions.CurveEaseOut,
animations: {
view.center.x = view.center.x + 20
},
completion: {
(finished: Bool) -> Void in
})
}
@IBAction func backgroundHeld(hold: UILongPressGestureRecognizer) {
switch hold.state {
case UIGestureRecognizerState.Began:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment