Skip to content

Instantly share code, notes, and snippets.

@MylesCaley
Last active December 30, 2016 16:07
Show Gist options
  • Save MylesCaley/459884d3429119c3de7f0e360a9f97e7 to your computer and use it in GitHub Desktop.
Save MylesCaley/459884d3429119c3de7f0e360a9f97e7 to your computer and use it in GitHub Desktop.
notes from animation tutorials
Fixes for animation tutorial
self.bounceOffPoint(bouncePoint, morphSize: morphSize)
==> self.bounceOff(point: point, morphSize: morphSize)
func animateCloud(cloud: UIImageView) {
//NOTE: use conventional formula for speed and time
let speed = self.view.frame.size.width / 60
let duration = (view.frame.size.width - cloud.frame.origin.x) / speed
UIView.animate(withDuration: TimeInterval(duration), delay: 0.0, options: [.curveLinear], animations: {
cloud.frame.origin.x = self.view.frame.width
}) { _ in
cloud.frame.origin.x = -cloud.frame.size.width
self.animateCloud(cloud: cloud)
}
}
delay(seconds: 2.0) {
==>
delay(2.0) {
CGAffineTransform(scaleX: 1.0, y: 0.1).concat
==> CGAffineTransform(scaleX: 1.0, y: 0.1).concatenating
auxLabel.backgroundColor = UIColor.clear()
==> auxLabel.backgroundColor = UIColor.clear
info.layer.addAnimation(flyLeft, forKey: "infoappear")
==> info.layer.add(flyLeft, forKey: "infoappear")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment