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.
我有一个动画用于将可旋转的 UIView 捕捉到圆形网格。随着视图动画,我需要根据旋转视图位置更新另一个视图。
我怎样才能在旋转视图动画到位时获得它的位置?
当动画开始时,您可以启动一个函数,该函数将使用计时器轮询当前视图位置(我想您需要presentationLayer从视图层获取并从中获取位置值)。
presentationLayer
CAAnimation 没有回调,animationDidStart因此animationDidStop似乎就是解决方案(如果我没记错的话,在 WWDC 视频之一中也提到过)。
animationDidStart
animationDidStop