나는 많은 물건과 Apple의 참고 문헌을 검색했지만 여전히 내 문제를 관리 할 수 없습니다.
내가 가진 것 :
- 2 
UIImageView초와 2UIButton초가 연결된 화면 - 2 가지 애니메이션 :
- 한 번만 각 이미지를 차례로 확장 및 축소 
viewDidLoad - 버튼을 누르면 (각각의 ‘내부’에 숨겨진 사용자 정의 버튼 
UIImageView) 둘 다가UIImageView아닌 적절한 애니메이션이 트리거됩니다 (확장, 축소). - iOS4 + 용으로 글을 쓸 때 블록 기반 애니메이션을 사용하라는 지시를 받았습니다!
 
 - 한 번만 각 이미지를 차례로 확장 및 축소 
 
내가 필요한 것:
실행중인 애니메이션을 취소하려면 어떻게합니까? 나는 마지막 하나를 제외하고 결국 취소했습니다 … : /
내 코드 스 니펫은 다음과 같습니다.
[UIImageView animateWithDuration:2.0
                               delay:0.1
                             options:UIViewAnimationOptionAllowUserInteraction
                          animations:^{
        isAnimating = YES;
        self.bigLetter.transform = CGAffineTransformScale(self.bigLetter.transform, 2.0, 2.0);
    } completion:^(BOOL finished){
        if(! finished) return;
        [UIImageView animateWithDuration:2.0
                                   delay:0.0
                                 options:UIViewAnimationOptionAllowUserInteraction
                              animations:^{
            self.bigLetter.transform = CGAffineTransformScale(self.bigLetter.transform, 0.5, 0.5);
        } completion:^(BOOL finished){
            if(! finished) return;
            [UIImageView animateWithDuration:2.0
                                       delay:0.0
                                     options:UIViewAnimationOptionAllowUserInteraction
                                  animations:^{
                self.smallLetter.transform = CGAffineTransformScale(self.smallLetter.transform, 2.0, 2.0);
            } completion:^(BOOL finished){
                if(! finished) return;
                [UIImageView animateWithDuration:2.0
                                           delay:0.0
                                         options:UIViewAnimationOptionAllowUserInteraction
                                      animations:^{
                    self.smallLetter.transform = CGAffineTransformScale(self.smallLetter.transform, 0.5, 0.5);
                }
                                      completion:^(BOOL finished){
                                          if (!finished) return;
                                          //block letter buttons
                                          [self.bigLetterButton setUserInteractionEnabled:YES];
                                          [self.smallLetterButton setUserInteractionEnabled:YES];
                                          //NSLog(@"vieDidLoad animations finished");
                                      }];
            }];
        }];
    }];
smallLetter UIImageView(버튼을 통해) 눌렀을 때 bigLetter애니메이션이 제대로 취소 되기 때문에 어떻게 든 제대로 작동하지 않습니다 .
편집 :
나는이 솔루션을 사용했지만 여전히 축소에 문제가 있습니다 smallLetter UIImageView-전혀 취소하지 않습니다 …
 솔루션
EDIT2 : 다음 / 이전 방법의 시작 부분에 이것을 추가했습니다.
- (void)stopAnimation:(UIImageView*)source {
    [UIView animateWithDuration:0.01
                          delay:0.0
                        options:(UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction)
                     animations:^ {
                         source.transform = CGAffineTransformIdentity;
                     }
                     completion:NULL
     ];
}
문제가 계속됩니다 … : / 애니메이션 체인의 문자에 대한 마지막 애니메이션을 중단하는 방법을 모릅니다
답변
다음을 호출하여 뷰의 모든 애니메이션을 중지 할 수 있습니다.
[view.layer removeAllAnimations];
(view.layer에서 메소드를 호출하려면 QuartzCore 프레임 워크를 가져와야합니다.)
모든 애니메이션이 아닌 특정 애니메이션을 중지하려는 경우 가장 좋은 방법은 UIView 애니메이션 도우미 메서드보다 명시 적으로 CAAnimations를 사용하는 것입니다. 그러면보다 세분화 된 제어가 가능하고 이름으로 명시 적으로 애니메이션을 중지 할 수 있습니다.
Apple Core Animation 문서는 여기에서 찾을 수 있습니다.
답변
iOS 10의 경우 UIViewPropertyAnimator를 사용하여 애니메이션을 적용합니다. UIView 애니메이션을 시작, 중지 및 일시 중지하는 방법을 제공합니다.
 let animator = UIViewPropertyAnimator(duration: 2.0, curve: .easeOut){
        self.view.alpha = 0.0
 }
 // Call this to start animation.
 animator.startAnimation()
 // Call this to stop animation.
 animator.stopAnimation(true)
답변
나는 removeAllAnimations를 부드럽게 다음 아이디어를 매우 편리하게 만들기 위해 Nick의 대답에 추가 할 것입니다.
[view.layer removeAllAnimations];
[UIView transitionWithView:self.redView
                  duration:1.0f options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
                      [view.layer displayIfNeeded];
                  } completion:nil];
답변
이것을 시도 할 수 있습니다 (Swift에서) :
UIView.setAnimationsEnabled(false)
UIView.setAnimationsEnabled(true)
참고 : 필요한 경우 두 호출 사이에 코드를 넣을 수 있습니다. 예를 들면 다음과 같습니다.
UIView.setAnimationsEnabled(false)
aview.layer.removeAllAnimations() // remove layer based animations e.g. aview.layer.opacity
UIView.setAnimationsEnabled(true)
답변
