Tuesday, November 11, 2025
HomeiOS Developmentios - Add CABasicAnimation animation to collectionView iphone13Pro will freeze or jitter...

ios – Add CABasicAnimation animation to collectionView iphone13Pro will freeze or jitter in animation

[ad_1]

let animation = CABasicAnimation(keyPath: "place")
animation.period = 0.6
animation.timingFunction = CAMediaTimingFunction(controlPoints: 0.3, 1.3, 0.3, 1)
animation.fromValue = CGPoint(x: collectionView.layer.place.x , y:       collectonView.layer.place.y + 250)
animation.toValue = CGPoint(x: collectionView.layer.place.x , y:  collectionView.layer.place.y)
assortment.layer.add(animation, forKey: nil)

when controlPoints y-axis exceeds 1,13Pro and iPadPro will jitter.

However once I use CAKeyFrameAnimation , I attempt to simulate factors on the Bezier curve

let animation = CAKeyframeAnimation(keyPath: "place")
    animation.period = 0.6
    animation.values = [CGPoint(x: collectionView.layer.position.x , y: collectionView.layer.position.y + 250),
                        CGPoint(x: collectionView.layer.position.x , y: collectionView.layer.position.y + 142),
                        CGPoint(x: collectionView.layer.position.x , y: collectionView.layer.position.y + 61),
                        CGPoint(x: collectionView.layer.position.x , y: collectionView.layer.position.y + 15),
                        CGPoint(x: collectionView.layer.position.x , y: collectionView.layer.position.y - 3.1),
                        CGPoint(x: collectionView.layer.position.x , y: collectionView.layer.position.y - 7.4),
                        CGPoint(x: collectionView.layer.position.x , y: collectionView.layer.position.y - 6.4),
                        CGPoint(x: collectionView.layer.position.x , y: collectionView.layer.position.y - 4.2),
                        CGPoint(x: collectionView.layer.position.x , y: collectionView.layer.position.y - 2.1),
                        CGPoint(x: collectionView.layer.position.x , y: collectionView.layer.position.y - 0.4),
                        CGPoint(x: collectionView.layer.position.x , y: collectionView.layer.position.y)];
    animation.isRemovedOnCompletion = false
    collectionView.layer.add(animation, forKey: nil)

animation is executed usually.

is it a ProMotion Refresh problem?
how one can repair it?

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments