Questions tagged [caanimation]

CAAnimation is an abstract animation class from Apple QuartzCore framework. It provides the basic support for the CAMediaTiming and CAAction protocols.

All Core Animation's animation classes descend from the abstract class CAAnimation. CAAnimation adopts the CAMediaTiming protocol which provides the simple duration, speed, and repeat count for an animation. CAAnimation also adopts the CAAction protocol. This protocol provides a standardized means for starting an animation in response to an action triggered by a layer.

For more information, see the Apple Documentation for CAAnimation.

457 questions
141
votes
14 answers

Animate text change in UILabel

I'm setting a new text value to a UILabel. Currently, the new text appears just fine. However, I'd like to add some animation when the new text appears. I'm wondering what I can do to animate the appearance of the new text.
Joo Park
  • 2,955
  • 4
  • 24
  • 31
75
votes
5 answers

UIView animation vs CALayers

I'm struggling with conceptualizing animations with a CALayer as opposed to UIView's own animation methods. Throw "Core Animation" into this and, well, maybe someone can articulate these concepts from a high level so I can better visualize what's…
Meltemi
  • 36,348
  • 48
  • 182
  • 274
48
votes
4 answers

CATransaction completion being called immediately

I'm trying to execute a completion-block after my CAAnimation has finished. However, it seems that animation block is called before my animation completes. The animation still happens correctly though. [CATransaction begin]; [self.view.layer…
Javache
  • 3,307
  • 3
  • 18
  • 25
33
votes
3 answers

How can I create an CABasicAnimation for multiple properties?

I have this code to animate a CALayer element. CABasicAnimation *makeBiggerAnim=[CABasicAnimation animationWithKeyPath:@"radius"]; makeBiggerAnim.duration=0.2; makeBiggerAnim.fromValue=[NSNumber…
Mc-
  • 3,718
  • 8
  • 34
  • 57
28
votes
3 answers

Making an animation to expand and shrink an UIView

I want to create an animation that will resize an UIView and its contents by a factor. Basically, I want to make an animation that first expands the view then shrinks it back to the original size. What is the best way to do this? I tried…
Flying_Banana
  • 2,707
  • 2
  • 18
  • 35
22
votes
5 answers

How to chain different CAAnimation in an iOS application

I need to chain animations, CABasicAnimation or CAAnimationGroup but I don't know how to do it, the only that I do is that all the animation execute at the same time for the same layer. How could I do it? For example, a layer with its contents set…
torhector2
  • 433
  • 1
  • 5
  • 19
20
votes
3 answers

Need better and simpler understanding of CATransform3D

Please go through the images. So this is the code which I got from some online source and it does transform my object. Besides that, I understood nothing at all. I am new to CATransform3D and want to know exactly how it works. CATransform3D…
mayuur
  • 4,696
  • 4
  • 28
  • 65
18
votes
5 answers

How to do a curve/arc animation with CAAnimation?

I have an user interface where an item get deleted, I would like to mimic the "move to folder" effect in iOS mail. The effect where the little letter icon is "thrown" into the folder. Mine will get dumped in a bin instead. I tried implementing it…
RickiG
  • 11,280
  • 13
  • 78
  • 120
17
votes
2 answers

How long is the animation of the transition between views on a UINavigationController?

Ideally, there would be some kind of constant containing this value. I'm implementing code that has it's own transition animations, and I'd like those to have the same length as the platform transition animations.
morais
  • 2,901
  • 5
  • 25
  • 26
13
votes
5 answers

UIButton not interacting during animation

I'm trying to animate a UIButton. But during it's animation, there is no interaction with the UIButton. Expected behavior is to be able to click on the button while it's moving. Here's the code snippet of the UIButton and animation: UIImage…
Frank
  • 2,913
  • 5
  • 36
  • 66
13
votes
1 answer

UIViewPropertyAnimator - simply stop all animations, rather than a specific one?

In UIViewPropertyAnimator, is there a way to just stop all UIViewPropertyAnimator animations? Or perhaps simply get all current animations - then of course you could stop them all. Can this be done? Or do you really have to (a) do only one per…
Fattie
  • 30,632
  • 54
  • 336
  • 607
12
votes
1 answer

Attempting to modify animatable properties, during an animation?

For a CALayer, which is animating, class Test: CAGradientLayer { override func draw(in ctx: CGContext) { super.draw(in: ctx) startPoint = .... } *** Terminating app due to uncaught exception 'CALayerReadOnly', reason:…
Fattie
  • 30,632
  • 54
  • 336
  • 607
12
votes
0 answers

What's the best approach to animate frame changes on NSView?

Ideally I'd need something like UIView.animateWithDuration, however I know that this is not an API that's available on macOS. What's the best way to manipulate the actual frame of an NSView and animate the changes? I tried going for…
Martin Velchevski
  • 834
  • 10
  • 30
12
votes
1 answer

UIPercentDrivenInteractiveTransition With CABasicAnimation

When using gesture driven UIPercentDrivenInteractiveTransition with CABasicAnimation (or any other CAAnimation), upon finishInteractiveTransition, animation jumps to final position, rather then animating smoothly as is the case when using UIView…
stringCode
  • 2,174
  • 1
  • 19
  • 32
12
votes
1 answer

Cannot get current position of CALayer during animation

I am trying to achieve an animation that when you hold down a button it animates a block down, and when you release, it animates it back up to the original position, but I cannot obtain the current position of the animating block no matter what.…
Matt
  • 2,910
  • 6
  • 20
  • 31
1
2 3
30 31