From 7e2813fe2ecf2733bd47b103f627eec0af0024af Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Thu, 30 Nov 2017 11:57:58 -0500 Subject: [PATCH] Clarify when completion is invoked in the docs. --- src/MDMMotionAnimator.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/MDMMotionAnimator.h b/src/MDMMotionAnimator.h index b81ed60..1ac537d 100644 --- a/src/MDMMotionAnimator.h +++ b/src/MDMMotionAnimator.h @@ -101,7 +101,9 @@ NS_SWIFT_NAME(MotionAnimator) UIKit types will be coerced to their Core Animation equivalent. Supported UIKit values include UIColor and UIBezierPath. @param keyPath The key path of the property to be animated. - @param completion The completion handler will be executed once this animation has come to rest. + @param completion A block object to be executed when the animation ends or is removed from the + animation hierarchy. If the duration of the animation is 0, this block is executed immediately. + The block is escaping and will be released once the animations have completed. */ - (void)animateWithTiming:(MDMMotionTiming)timing toLayer:(nonnull CALayer *)layer @@ -127,8 +129,9 @@ NS_SWIFT_NAME(MotionAnimator) @param animations The block to be executed. Any animatable properties changed within this block will result in animations being added to the view's layer with the provided timing. The block is non-escaping. - @param completion The completion handler will be executed once all added animations have come to - rest. The block is escaping and will be released once the animations have completed. + @param completion A block object to be executed once the animation sequence ends or it has been + removed from the animation hierarchy. If the duration of the animation is 0, this block is executed + immediately. The block is escaping and will be released once the animation sequence has completed. */ - (void)animateWithTiming:(MDMMotionTiming)timing animations:(nonnull void (^)(void))animations