Last active
December 30, 2016 16:07
-
-
Save MylesCaley/459884d3429119c3de7f0e360a9f97e7 to your computer and use it in GitHub Desktop.
notes from animation tutorials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes for animation tutorial |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.bounceOffPoint(bouncePoint, morphSize: morphSize) | |
==> self.bounceOff(point: point, morphSize: morphSize) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGAffineTransform(scaleX: 1.0, y: 0.1).concat | |
==> CGAffineTransform(scaleX: 1.0, y: 0.1).concatenating | |
auxLabel.backgroundColor = UIColor.clear() | |
==> auxLabel.backgroundColor = UIColor.clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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