是什么在完成块成品参数意味着animateWithDuration [英] What does the finished parameter in the completion block mean in animateWithDuration

查看:370
本文介绍了是什么在完成块成品参数意味着animateWithDuration的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解视图动画iOS中是如何工作的;我目前有我创建一个动画:

I'm trying to understand how view animations work in iOS; i currently have an animation that i create with:

+ (void)animateWithDuration:(NSTimeInterval)duration
                      delay:(NSTimeInterval)delay
                    options:(UIViewAnimationOptions)options
                 animations:(void (^)(void))animations
                 completion:(void (^)(BOOL finished))completion

但我有关于在完成块成品参数的问题;什么成品参数不我有所了解在这个意义上,如果完成后,将是动画实际发生的这是一件好事,但是这是什么意思,当它被设置为NO,什么是处理这种常见的方法通常,特别是如果你想链动画(调用完成块中的下一个动画)在同一个观点,即工作的?

But I've got a question concerning the finished parameter in the completion block; what the finished parameter does i somewhat understand in the sense that if finished is YES the animation actually happened which is a good thing, but what does it mean when it is set to NO and what is the common way to deal with this normally, especially if you want to chain animations (calling a next animation in the completion block) that work on the same view?

我想问的原因是因为它返回NO在有时原因我不清楚,因为视图在视图层次present并且没有其他动画干预。

The reason I ask is because it returns NO at sometimes for reasons unclear to me, as the view is present in the view hierarchy and there are no other animations intervening.

推荐答案

这意味着,出于某种原因或其他动画没有完成。视图可能已经从它的父例如除去或另一个动画可能已经应用到它,或其他的一些理由最著名苹果。你如何处理它是由你。你可以重新开始整个动画链,开始在最后的动画,或下。

It means that for some reason or another the animation did not complete. The view could have been removed from its superview for example or another animation could have been applied to it, or a number of other reasons best known to Apple. How you deal with it is up to you. You could start the entire animation chain again, start at the last animation, or the next.

这篇关于是什么在完成块成品参数意味着animateWithDuration的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆