본문 바로가기
프로그래밍 놀이터/iOS

[ios/reference] Animating Layer Content

by 돼지왕 왕돼지 2017. 11. 22.
반응형

 [ios/reference] Animating Layer Content


https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide/CreatingBasicAnimations/CreatingBasicAnimations.html

animation, animation notification, animationdidstart, animationdidstop, apply, begintime property, Block, caanimation, delegate, detect, finished, presentation tree, removeallanimations, removeanimationforkey, setcompletionblock, View, view constraint, [ios/reference] Animating Layer Content


-

Animation 은 보통 그 요청이 끝날 때까지 지속된다.

명시적으로 animation 을 끝내기 위해서는...


removeAnimationForKey: 또는 removeAllAnimations 함수를 호출하면 된다.



-

Animation 을 멈추면, 원래의 현재값으로 돌아간다.

만약 Animation 을 멈춘 시점에 그 값을 유지하려면, presentation tree 를 이용해서 값을 설정해주어야 한다.



-

Animation 종료를 detect 하기 위해서는 setCompletionBlock: 함수를 통해 block 을 전달하거나, CAAnimation 에 delegate 를 전달하고, animationDidStart: 와 animationDidStop:finished: 를 구현하면 된다.



-

한 animation 이 끝난 다음에 다음 animation 을 수행하고 싶다면,

animation notification 을 쓰지 말고, beginTime property 를 쓰는 것이 좋다.



-

View Constraint 로 view 를 설정해 놓았다면,

animation 에 방해가 될 수 있는 constraint 를 모두 제거한 후에 animation 을 돌리는 것이 좋다.

animation 이 끝나면 다시 apply 하는 것이 추천된다.




반응형

댓글