Core Animation

윤주현·2023년 7월 1일
0

Animation

목록 보기
2/4

Core Animation(CA)

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")
}

0개의 댓글

관련 채용 정보