Core Animation layers not animating as expected on iOS 16 with CATransform3D
I'm trying to animate a `CALayer` using `CATransform3D` in my iOS 16 app, but the animation doesn't seem to be working as intended. I want to rotate a square layer around the Y-axis, but the layer appears to be jumping instead of smoothly animating. Here is the code I am using: ```swift let squareLayer = CALayer() // Setting up the layer properties squareLayer.frame = CGRect(x: 100, y: 100, width: 100, height: 100) squareLayer.backgroundColor = UIColor.red.cgColor // Adding the layer to the view's layer self.view.layer.addSublayer(squareLayer) // Configuring the animation let rotationTransform = CATransform3DMakeRotation(.pi, 0, 1, 0) let animation = CABasicAnimation(keyPath: "transform") animation.toValue = NSValue(caTransform3D: rotationTransform) animation.duration = 2.0 animation.fillMode = .forwards animation.isRemovedOnCompletion = false // Triggering the animation squareLayer.add(animation, forKey: "rotationAnimation") ``` Despite setting `fillMode` to `.forwards`, the layer resets to its original position after the animation completes, and I see a noticeable jump back. I've also tried using `CAAnimationGroup`, but I encountered similar issues. Additionally, I verified that the layer's `position` and `bounds` properties are correct before the animation starts. I've checked the layer's `isHidden` property, and it's `false`. I even logged the layer's properties before and after the animation to ensure nothing is interfering, but I need to seem to pinpoint the scenario. I suspect it might be related to how the layer's transform is applied or the animation's settings. Can anyone provide insights on why the animation behaves this way or suggest alternative approaches? I'm using Swift 3.9 in this project. What am I doing wrong?