core-animation

What does the value 1e100f stand for?

I've seen this in a snippet: animation.repeatCount = 1e100f; my math classes are long time ago. So 1e100f would be a number with 100 zeros? So in this case the programer wanted to have infinite repeatCount? ...

Why does this CAKeyFrameAnimation stop with zero opacity?

I have this code. At the end of the values array, you can see I provide 0.5 for the opacity. But for some reason, when the animation stops, it flashes once again and then leaves the view completely transparent. What's wrong there? CALayer *layer = self.layer; CAKeyframeAnimation *blinkAnim = [CAKeyframeAnimation animationWithKeyPath:@...

Fading a UIView on top of a UITableView with Sections

Greetings! I've added a UIActivityIndicatorView as a subview of a UITableView. The intent is to fade this view out once the underlying table has been refreshed with new data. The problem is that the sections in the table view (e.g., A, B, C, etc.) appear to be added after the Activity Indicator appears, partially blocking the activity ...

How do I save state with CALayers?

I have a simple iphone application that paints blocks using a subclass of CALayer and am trying to find the best way to save state or persist the currently created layers. I tried using Brad Larson's answer from this previous question on storing custom objects in the NSUserDefaults, which worked for persisting my subclass of CALayer, bu...

What's the effect of setting timeOffset when animating?

The CAMediaTiming Protocol defines a timeOffset property. Now, they say it's a time offset. It sounds straightforward, but howefer, when I set it to 15.0 for example, the animation still imediately starts. The timeOffset doesn't seem to have any effect. Maybe someone can point that out a little bit? ...

How to specify an beginTime for an animation by using CFTimeInterval?

For my understanding, beginTime can be used to say "hey, start at exactly 12:00 'o clock". But how would I tell this with an CFTimeInterval type? I thought that this one is nothing more than a kind of "float" value to specify seconds. Or what else would be then the difference to the timeOffset property that is specified in CAMediaTiming...

What does fillMode do exactly?

The documentation is not talking really much about what this technically does. fadeInAnimation.fillMode = kCAFillModeForwards; I don't really see the effect of this. I have an view with alpha set to 0.0. Then I fade it in. But when I uncomment the line abouth, nothing changes. Same behavior. I'd like to understand what this fillMode r...

What do they mean by "the timespace of the animation's layer" and "in the local active time"?

They say: The timing protocol provides the means of starting an animation a certain number of seconds into its duration using two properties: beginTime and timeOffset. The beginTime specifies the number of seconds into the duration the animation should start and is scaled to the timespace of the animation's layer. The...

Strange graphics glitch when using flip animation.

Hey guys, I'm getting a strange error when committing a flip animation. These three bars show up, almost like strips that aren't being drawn too. I got a screenshot to show what I'm talking about. These lines are always in the same place, and show up on both sides. Here is the code that I'm using, I've used it before without problem...

How is the UIView integration with Core Animation? Layer hosting or layer-backed views?

I am not very sure, but I would bet on layer-backed views. That is: Layer-backed views use Core Animation layers as their backing store,freeing the views from the responsibility of refreshing the screen. The views need to redraw only when the view content actually changes. Or is it the other method of integration? ...

Scaling not as smooth in 3.0 as in 2.x

I have a CATiledLayer backed UIView that is added to UIScrollView and it is returned as view to be scaled in response to -(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView delegate method. Now the problem is that scaling on a scale falling between the 2x steps provided by CATiledLayer (like for example 1.333) results in v...

CGPath Animation

Hi, I need some sample code where I can animate a curve/arc path which should draw a full circle as animated? Any input will be appreciated. Thanks, Sat ...

Does iPhone OS support implicit animation?

Example from Mac OS X: [[aView animator] setFrame:NSMakeRect(100.0,100.0,300.0,300.0)]; I have tried something similar in UIKit, but it seems the animator method is not there for UIView. So there's no "implicit" animation? ...

How is the relation between UIView's clipsToBounds and CALayer's masksToBounds?

A UIView has a CALayer. That's pretty sure. But both seem to provide something that means the same thing. If I'd set clipsToBounds=YES, would this also set the layer's masksToBounds=YES? Why different names? Anyone knows? ...

Can custom transforms be used (in theory) to create a water ripple effect on a CALayer?

It's possible to create custom transform matrices. But I wonder if they are suited for making water ripple effects on a CALAyer. Think of 20 of them in an animation. Can someone tell? ...

Will sending -removeAllAnimations to a layer also propagate to all it's sublayers?

I wonder if sublayer animations would continue to play if I send -removeAllAnimations to a parent layer. ...

How to detect when a CATiledLayer has finished drawing all tiles

I need to detect when a CATiledLayer has finished drawing. I tried subclassing and overriding -(void)display to set/clear a flag, but it seems that tile drawing is happening in a different thread (display just returns and then seconds later, the layer is finished drawing) ...

UITableView display distorted before setAnimationTransition during view swap

Greetings! I'm trying to borrow the view flip concept from Apple's TheElements sample app. This sample employs a container UIView in which you can swap between two subviews. The flip is achieved using setAnimationTransition:forView:cache: and removing/adding each subview. In general, the flip works and I can swap between my two views (a...

Does someone know what's the magic behind the Render-Tree?

The Layer-Tree and Presentation-Tree are pretty clear. But the Render-Tree is not. Since it is private API and Apple doesn't talk much about it, I would still like to know more details about what's going on there. Does anyone know? ...

in which situations does it make sense to create only an lighteight CALayer rather than a fat UIView?

The only thing that comes in my mind is displaying simple images. But that wouldn't make sense if you want to animate them, right? So is it any useful to make a CALayer only instead of an UIView that comes along with a whole bunch of them (all those trees...)? ...