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
3
votes
1 answer

CAKeyframeAnimation - Stopping Infinite Loop

I have the following lines of code to run animation with some frames. - (void)setAnimation { /* creating a layer */ CALayer *layer = [[CALayer alloc] init]; [layer setBounds:self.bounds]; [layer…
El Tomato
  • 6,479
  • 6
  • 46
  • 75
3
votes
1 answer

Swift CAKeyframe Animation not displaying images

I have set up a very simple Single View Application (in Swift) using iOS 8.1. I have added one UIImageView to the main view controller view. I am trying to use CAKeyframeAnimation to animate a sequence of images. I was originally using the…
prajna
  • 1,629
  • 1
  • 17
  • 18
3
votes
1 answer

Intermittent fillMode=kCAFillModeForwards bug using CAKeyframeAnimation with path

I'm having an intermittent problem when I move a UIImageView around the screen using CAKeyframeAnimation. I want the position of the UIImageView to remain where the animation ends when it is done. This bug only happens for certain start and end…
Mark24x7
  • 1,447
  • 1
  • 11
  • 9
3
votes
1 answer

CAKeyframeAnimation with loop

I'm trying to create a CAKeyframeAnimation with a little twist. I want part of the keyframe animation to loop for a while before going straight to the end. For example: Intro: play keyframes 0 to 10 Loop: play keyframes 11 to 15 (repeat for a…
Martin Cote
  • 28,864
  • 15
  • 75
  • 99
3
votes
2 answers

CAKeyframeAnimation not animating CATextLayer when exporting video

I have an application that I am attempting to put a timestamp on a video. To do this I am using AVFoundation and Core Animation to place a CATextLayer over the video layer. If I place text into the CATextLayer's string property, the string is…
3
votes
1 answer

How to let a CAKeyframeAnimation pick up the current state when overriding another?

I have one like this: CALayer *layer = stripeButton.layer; CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"bounds.origin.y"]; moveAnim.duration = 3.35; moveAnim.repeatCount = 0; moveAnim.autoreverses =…
HelloMoon
3
votes
0 answers

CAKeyframeAnimation repeat after a delay

I have 3 uiviews which have a CAKeyframeAnimation layer added to them to bounce. Currently i add these to each uiview after a delay and set them to repeat. What i need them to do is repeat but after a delay. so view 1 animates, but waits till after…
Dan
  • 1,447
  • 2
  • 14
  • 30
3
votes
2 answers

Unable to combine CAKeyframeAnimations for scale and translation

I would like to effect the scale and translation of a layer's transform at the same time but only the translation animation runs. Here is the errant code... Here I create the scale animation with the keypath to scale.y: …
leebert
  • 83
  • 1
  • 6
2
votes
1 answer

Making an image follow only a portion of a CGPath

I realize it's not very difficult to make an image follow a pre-determined path on iPhone (see here), but I'm wondering if it's possible for the image to only follow part of the path. For example, if I have a path that goes from A to B, how do I get…
2
votes
1 answer

Setting start position of CAKeyframeAnimation that follows an elliptical path

I am trying to animate a UIView in a circle using a CAKeyframeAnimation that follows a path created with CGPathAddEllipseInRect, which I have set up fine. Is there a way, however, to set the start position of the animation? My code is: //set up…
2
votes
1 answer

iOS CAKeyFrameAnimation Rotate

I have written this CAKEyFrameAnimaton to rotate a CALayer on it's X-axis. But it is not rotating. What am I doing wrong here? CAKeyframeAnimation *topFoldAnimation = [CAKeyframeAnimation…
Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
2
votes
1 answer

CAKeyframeAnimation not changing position as expected

I want to add an entrance animation to my UIView layer that left-shifts + fades-in with a slight bounce at the end. I assign a values array to animation.values, but when the animation runs, it seems to always skip the third value. It appears as a…
treesan
  • 49
  • 2
2
votes
1 answer

How to animate contentsRect property along a path?

I have a png sprite sheet and corresponding plist file loaded and I'm trying to animate contentsRect property of a CALayer to display a sprite animation from the above mentioned aprite sheet. Here is a code: CGFloat width =…
PrimeSeventyThree
  • 940
  • 2
  • 9
  • 24
2
votes
1 answer

Are the key frames in a CAKeyframeAnimation always hit exactly?

Can anyone tell me if the key frames in a CAKeyframeAnimation are always guaranteed to be hit with their exact values when the animation runs? Or... do they only act as interpolation guides? e.g. If I specify, say, 3 points on a path for some…
VectorVictor
  • 693
  • 1
  • 10
  • 20
2
votes
1 answer

How to animate object using bezier path?

Here is my code to draw dashed line func drawLine() { let shapeLayer = CAShapeLayer() shapeLayer.bounds = viewDraw.bounds shapeLayer.position = CGPoint(x: viewDraw.bounds.width/2, y: viewDraw.bounds.height/2) shapeLayer.fillColor =…
Jitendra Modi
  • 2,344
  • 12
  • 34