티스토리 뷰

🍎 iOS/UIKit

UIView.Animate

yeding 2024. 7. 15. 12:06

1. 작은 크기에서 크게 커지는 애니메이션

정해진 위치에서 커지는 것이라 레이아웃은 변경하지 않음

크기가 10분의 1로 줄어듬

//크기를 10분의 1로 줄임
logoImageView.transform = CGAffineTransform(scaleX: 0.1, y: 0.1)

 

1-1) 회전하면서 원상태로 만들기

 UIView.animate(withDuration: 0.5, delay: 1, options: .curveEaseIn){
    self.logoImageView.transform = CGAffineTransform(rotationAngle: 180)
}  completion: { _ in
    self.animationEmailTextField()
}

 

1-2) 원상태로 크기 만들기

UIView.animate(withDuration: 0.5, delay: 1, options: .curveEaseIn){
    self.logoImageView.transform = CGAffineTransform(scaleX: 1, y: 1)
}  completion: { _ in
    self.animationEmailTextField()
}

 

1-3) 스프링 효과 주기

UIView.animate(withDuration: 0.5, delay: 1, usingSpringWithDamping: 0.5, initialSpringVelocity: 0.5) {
    self.logoImageView.transform = CGAffineTransform(rotationAngle: 180)
} completion: { _ in
    self.animationEmailTextField()
}

'🍎 iOS > UIKit' 카테고리의 다른 글

구현하며 알게된 자주쓰는 UIKit 속성들  (0) 2024.07.14
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2026/02   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
글 보관함