UIKit안에 들어있다.
장점 : 속도가 빠르다.
UIVIew 밑에 있는 CA layer 에서 이루어짐
private func shakeButton() {
let animation = CAKeyframeAnimation()
animation.keyPath = "position.x"
animation.values = [0, 10, -10, 10, 0] // + 오른쪽, - 왼쪽
animation.keyTimes = [0, 0.16, 0.5, 0.83, 1] // percent의 개념
animation.duration = 0.4
animation.isAdditive = true
// accessing CALayer of SignInButton and add animation
signInButton.layer.add(animation, forKey: "shake")
}