본문 바로가기
[ios/tutorial] Implicit Animation 없이 property 값 바꾸기 [ios/tutorial] Implicit Animation 없이 property 값 바꾸기 -예를 들면 버튼의 text 를 바꿀 경우, 자연스럽게 글자가 fade out - fade in animation 이 먹는다.순간적으로 버튼의 text 를 바꿀 경우 이는 원하지 않는 동작일 수 있다. -다음 코드를 수행하면 implicit animation 없이 바로 작업을 수행할 수 있다.[UIView performWithoutAnimation:^{ [self.btn setTitle:btnText forState:UIControlStateNormal]; [self.btn layoutIfNeeded];}]; [ios/tutorial] Implicit Animation -> Layer Level 에 대한 이야기 .. 2017. 12. 13.
[ios/tutorial] Core Animation 모든 것!! [ios/tutorial] Core Animation 모든 것!! 참고 : https://www.objc.io/issues/12-animations/animations-explained/ -Animation 을 수행하는 방법은 크게 2가지. 1. UIView 의 class method “animateWithDuration:” 을 사용하는 방법2. Core Animation 을 사용하는 방법. Simple Animation 이 아니라면 Core Animation 을 사용하는 것이 추천된다.훨씬 코드의 가독성이 좋고, 더 많은 기능을 제공한다.But, 더 많은 학습을 필요로 한다. 물론 애플의 권장사항은 할수만 있다면 항상 UIKit 에서 제공되는 Animation 을 사용하길 원한다. -Core Anima.. 2017. 11. 30.
[ios/tutorial] Implicit Animation [ios/tutorial] Implicit Animation -View 에 붙어 있지 않은 Layer property 들은 기본적으로 implicit animation 을 한다. -Implicit Animation 을 끄려면 다음과 같이 한다.[CATransaction begin];[CATransaction setValue:[NSNumber numberWithBool:YES] forKey:kCATransactionDisableActions]; // property setting [CATransaction commit]; -아래와 같은 코드로 View 에 붙어있는 Layer 에도 Implicit animation 을 줄 수 있다.또한 standalone animation 의 implicit animatio.. 2017. 11. 28.
반응형