본문 바로가기

Development/IOS & Mac

[IOS] UIView Animation 연속적인 호출시 유용

IOS에서 보통 UIView에 애니메이션을 적용할 때


[UIView beginAnimations:nil context:NULL];

애니메이션.....

[UIView commitAnimations];


위의 소스로 연속적으로 애니메이션을 호출할 경우 애니메이션이 부드럽지 않고 딱딱 끊어짐? 현상이 발생하는 경우가 있다 그럴때 아래와 같이 setAnimationBeginsFromCurrentState 을 설정하면 애니메이션 하는 상태에서 다시 실행하여서 부드럽게 연출이 된다.


[UIView beginAnimations:nil context:NULL];

[UIView setAnimationBeginsFromCurrentState:YES];

애니메이션.....

[UIView commitAnimations];