私は古いプロジェクトに取り組んでおり、除外したいPOP frameworkネイティブiOSフレームワークでアニメーションを行うことができると確信しています。Swiftの `POPSpringAnimation`からネイティブiOSフレームワークへの移行
[UIView animateWithDuration:1.0
delay:0
usingSpringWithDamping:springBounciness
initialSpringVelocity:springVelocity
options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.selectedViewController.view.frame = rect;
} completion:^(BOOL finished) {
// cool code here
}];
をしかし、私は同じ結果を得るいけない、といくつかの疑問が上昇:私は試してみました何
POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewFrame];
springAnimation.toValue = [NSValue valueWithCGRect:rect];
springAnimation.velocity = [NSValue valueWithCGRect:CGRectMake(springVelocity, springVelocity, 0, 0)];
springAnimation.springBounciness = springBounciness;
springAnimation.springSpeed = springSpeed;
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
if (finished) {
// cool code here
}
}];
[self.selectedViewController.view pop_addAnimation:springAnimation forKey:@"springAnimation"];
:ここ
は、古いコードです
- です
springBounciness
ポップでusingSpringWithDamping
に相当? springSpeed
と同等のものはUIView
ですか?- どのくらいの期間、どのくらいの期間が
POPSpringAnimation
ですか?
編集: 3番目の質問については、Githubでissueが見つかりました。
UIView
は、コアアニメーションやその他のiOSネイティブアニメーションフレームワークを使用して行うことができますか?
Popはダンプニングを決定するために特殊なソルバを使用しています。あなたはCASpringAnimationに近づくかもしれませんが、Popは勝てません。とりわけ割り込み性がある。 – agibson007
再びお詫び申し上げますが、この場合、ソルバーは解消されます。質問1にもはい。私は2が減衰と初期速度の組み合わせだと思います。 3.ソルバーは、ダンペネリングとビューのサイズを使用して、バネの弾力で解決します。 – agibson007
@iosgeek plsが私の答えをチェックします。 ty。 – GeneCode