Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
核心动画在它们自己的线程上运行。但是animationDidStop:finished:动画完成后保证在主线程上运行吗?在我的测试中确实如此,但我不知道我是否可以在所有时间和所有版本的 iOS 中依赖它。
animationDidStop:finished:
它确实发生在主线程上,正如这个线程中提到的那样。从 iOS 4.0 及更高版本开始考虑使用block-based animation methods。
block-based animation methods
编辑
从官方文档的描述中animateWithDuration:animations:completion:提到,完成块在下一个运行循环周期的开始执行。如果您在主线程上调用您的方法,我相信我们在这里谈论的是与主线程相关的循环周期。
animateWithDuration:animations:completion:
我的理解是,该animationDidStop:finished:方法总是在主线程上调用,但这是一种理解,而不是保证。
您可能希望将此问题发布到 Apple 开发者论坛的 Core Animation 区域,并提出 Apple 工程师参与的具体要求。有许多 Apple 员工定期发布他们的问题。(Core Animation 想到了 Rincewind)。