I have a CAKeyframeAnimation that looks great in landscape but when the device rotates the animate is of course out of place compared to the rest of the content. Is there a way to adjust (scale) the path of an animation in progress?
Edit: Adding Code
let circle = CAShapeLayer()
circle.path = UIBezierPath(roundedRect: CGRect(x: -60.0, y: -60.0, width: 100.0, height: 100.0), cornerRadius: 50.0).cgPath
circle.fillColor = UIColor.clear.cgColor
circle.strokeColor = UIColor.blue.cgColor
let animation = CAKeyframeAnimation(keyPath: "position")
animation.duration = (path["endTime"] as! Double) - (path["startTime"] as! Double)
animation.repeatCount = 0
animation.path = (path as! UIBezierPath).cgPath
animation.calculationMode = kCAAnimationPaced
animation.fillMode = kCAFillModeForwards
animation.isRemovedOnCompletion = false
circle.add(animation, forKey: "position")
self.view.layer.insertSublayer(circle, at: 5)
The problem is that the UIBezierPath is defined in either Portrait or Landscape (the app supports both) so playback at the same orientation that it was created is no problem, but if you rotate the device the Animation defined by the UIBezierPath should be updated for the new orientation. I'm just looking for a method of updating the CAKeyframeAnimation path to the new coordinate system while it is animating.