Questions tagged [cakeyframeanimation]

Describes an animation that provides keyframe interpolation of a layer property in Apple's Core Animation framework.

CAKeyframeAnimation is a Core Animation animation type that provides keyframe interpolation of a layer property. Instances should be created with the initializer animationWithKeyPath:.

For more information, see the Apple Documentation for CAKeyframeAnimation.

235 questions
0
votes
1 answer

How to get current screen xy position of a CAKeyframeAnimation object?

In Swift 4.2 under iOS 12 beta 12 I would like to get the current position of a dot I have animated along a path in a CAKeyframeAnimation. The code for the animation is this: @IBOutlet weak var dot: UIImageView! func animateDot() { …
Rob Tow
  • 111
  • 8
0
votes
0 answers

CAAnimation - incorrect interpretation of `transform`?

I'm running into some very weird behavior with CAAnimation that I'm trying to understand. I've managed to boil it down to a simple reproduction case: Create a simple CAKeyframeAnimation with keyPath="transform" Create a CATransform3D which is any…
Elte Hupkes
  • 2,773
  • 2
  • 23
  • 18
0
votes
1 answer

CaKeyframeAnimation persisting in background after dismissing view controller

Hi I have simple CAShapeLayer animation let ballFrameAnimation = CAKeyframeAnimation() aBall.removeFromSuperlayer() self.view.layer.addSublayer(aBall) ballFrameAnimation.keyPath = "position" ballFrameAnimation.duration = 3.0 …
0
votes
1 answer

iOS - Using addSubView on a UIScrollView

I am trying to use this bit of code: [[myUIView layer] addSublayer: layer]; [myScrollView addSubview:myUIView]; [layer addAnimation:[self imagesAnimation] forKey:@"images"]; What I am doing to do is taking a layer that will later get a…
Mytheral
  • 3,929
  • 7
  • 34
  • 57
0
votes
1 answer

CAKeyframeAnimation with path; can the path be extended to extend the animation?

You would be familiar with the games where a train moves slowly along a track that is made from puzzle pieces - if you can't tile more pieces onto the track the train crashes and you lose. One way to do this would be to make the train follow a path…
Adam Eberbach
  • 12,309
  • 6
  • 62
  • 114
0
votes
1 answer

How to remove strange delay between two sequential CAKeyframeAnimation animations?

iOs-coders! This code to animate the little red square to drawing big sign "8" on the UIView. First an upper ring (animSequence1 = 5 sec), then right away a lower ring (animSequence2 = another 5 sec). No delay needed! But I stucked on strange delay…
Nazar
  • 1
  • 2
0
votes
2 answers

How do I control animation timing along a NSBezier path?

In Apple's docs about CAKeyframeAnimation they say: "For most types of animations, you specify the keyframe values using the values and keyTimes properties. During the animation, Core Animation generates intermediate values by interpolating…
Bob Ueland
  • 1,804
  • 1
  • 15
  • 24
0
votes
1 answer

CAKeyframeAnimation key times after 1.0 sec not executing

For some strange reason when I put in key times after 1 second they don't appear to execute but when I keep all my key times 1 second and under they all execute properly. Not sure why this is happening, anyone have any ideas? This is the function…
SwiftyJD
  • 5,257
  • 7
  • 41
  • 92
0
votes
1 answer

animate the position switching of 2 imageViews

We're trying to animate the switching of position of 2 imageview views along the z access. The 2 imageViews are the 2 at the to of the screen So far I've tried using a CAAnimationGroup for position and rotation but it's only show one of the images…
SwiftyJD
  • 5,257
  • 7
  • 41
  • 92
0
votes
0 answers

CATextLayer's `foregroundColor` not working with CAKeyframeAnimation and timeOffset?

I need to animate the color of CATextLayer, and the animation itself works: CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"foregroundColor"]; animation.duration = 1.0f; animation.values = @[(id)([UIColor…
Heuristic
  • 5,087
  • 9
  • 54
  • 94
0
votes
0 answers

CAKeyframeAnimation different on device / simulator

So I am using a CAKeyframeAnimation to spin a layer 360*s. It works as intended on iPhone 6 and iOS Simulator: http://www.goloskok.com/u/cap_2016-12-02_12-51-28_pm.mov but looks different on iPad mini 1st…
Alexandre G
  • 1,655
  • 20
  • 30
0
votes
1 answer

How to get coordinates of view during animation?

I've created CAShapeLayer and added Bezier Cubic path(with addCurveToPoint:controlPoint1:controlPoint2: function) and added a little view on start point of that curve. After that I've created CAKeyFrameAnimation and moved that little view from start…
passingnil
  • 403
  • 1
  • 5
  • 14
0
votes
1 answer

Delay start of animation for UIView with CAKeyframeAnimation?

The following code was pulled from another SO answer, but is it possible to delay the start of this CAKeyframeAnimation animation similar to how UIView's animateWithDuration offers a delay property? Based on the class docs, the CAKeyframeAnimation…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
0
votes
2 answers

CAKeyFrameAnimation is not animating when using CGPath

I am trying to animate a dot around a rect in a circular fashion. For that I created an oval UIBezierPath, created a CAKeyFrameAnimation and set the path for keyPath 'position'. I setup a project to experiment with animations and got something…
Robin Dorpe
  • 344
  • 3
  • 7
0
votes
2 answers

How to stop CAKeyframeAnimation in UIScrollView.layer.addAnimation - removeAnimationForKey and removeAllAnimations do nothing

I have animated a UIScrollView this way: let anim = CAKeyframeAnimation() anim.keyPath = "bounds.origin.x" anim.values = self.animValues anim.keyTimes = self.animKeyTimes anim.duration = self.animDuration anim.additive =…
David Reich
  • 709
  • 6
  • 14