core-animation

Is a keyframed transition possible in Core Animation?

I know that keyframed transitions are possible in Core Animation via setting the path property on the CAAnimation instance. However, CATransition does not seem to have this functionality. Does anyone know any other ways to control the transition apart from setting the timing function? ...

Evernote app "Tips" image overlaying UITableView

The Evernote application has a tips pane which hangs over a UITableView on the initial window. When you click on tips, a straight forward animation happens with a tips pane sliding up into view. My question is, how is that tips pane implemented in the sense that, you absolutely have to click on the tab sticking out for it to animate. An...

Widget "flip" behavior in Core Animation/Cocoa

I'm trying to make a Card class that duplicates the behavior of Dashboard widgets in that you can put controls or images or whatever on two sides of the card and flip between them. Layer backed views have a transform property, but altering that doesn't do what I would expect it to do (rotating the layer around the y axis folds it off ...

Do CALayers block Touch Events in underlying views?

I have an application with a view containing several subviews. The subviews did not implement any touchesbegins logic. The Superview implemented all touchesbegins logic and manipulated each subview respectively if it was touched (determined by hit testing). I have since been converting my subviews to layers. My problem now is that ...

Best Practice: Animating a view into display onto iPhone

If I'm looking to use Core Animation to fade a view in and out of display -- is it good practice to have the UIView in the same NIB as the view that it is being drawn into? Should I build the view in another NIB file and load it in from there? I'm looking to animate three small views into display simultaneously upon a user action. I want...

layer hit test only returning layer when bottom half of layer is touched

I have a sublayer on a layer-backed view. The sublayer's contents are set to an Image Ref and is a 25x25 rect. I perform a hit test on the super layer when the touchesBegan and touchesMoved methods are invoked. The hit test method does, in fact, return the sublayer if it is touched, BUT only if the bottom half of the image is touched. ...

Animation End Callback for CALayer?

Using iPhone CALayer, I want a rotation animation for my spirit layer, but I also want a callback for the animation end, hot to do that? I think maybe I should use CABasicAnimation, but I don't know how to do rotation using CABasicAnimation, any idea? Thanks ...

Convert a CGPoint from a UIView coordinate system to a CALayer coordinate system

There are methods to transfer a CGPoint from one UIView to another and from one CALayer to another. I cannot find a way to change a CGPoint from a UIView's coordinate system to a CALayer's coordinate system. Does a layer and it's host view have the same coordinate system? Do I need to transform points between them? Thanks, Corey ...

Using Core Animation, is there a way to group animations for several CALayers?

I have a situation where I have many CALayers which animate in a "turn based" fashion. I animate the position on each of those CALayers, but they have the exact same duration. Once all of those CALayers are finished animating, a new "turn" is initiated and they animate changing positions again. The whole idea is that with a linear inter...

How do I pan the image inside a UIImageView?

I have a UIImageView that is displaying an image that is wider and taller than the UIImageView is. I would like to pan the image within the view using an animation (so that the pan is nice and smooth). It seems to me that I should be able to just adjust the bounds.origin of the UIImageView, and the image should move (because the image s...

UIImageView animations slow

I've got a UIImageView with about 10 full-screen jpegs, totaling about 128k. Throwing these into the UIImageView with setAnimationImages works like a champion in the emulator until I try to run it on the iPhone which results in a fail. Is something wrong here? I would think with all the fancy 3d games I've seen my crappy little animat...

iPhone "slide to unlock" animation

Any ideas as to how Apple implemented the "slide to unlock" (also, "slide to power off" is another identical example) animation? I thought about some sort of animating mask - but masking is not available on the iPhone OS for performance reasons. Is there some private API effect (like SuckEffect) that they might have used? A spotlight t...

Method for animating images (like a movie) on iPhone without using MPMoviePlayer

I need to be able to display an animation over a static image. Given that MPMoviePlayer gives you no control over anything useful, the only way I can think to do this is to use multiple static images, which we display (one-by-one) to create a "movie like" animation. I know we could use UIImageView to do this (by setting the UIImageVi...

Core Animation with a Core Graphics drawing

I am inside a UIView subclass (CustomView in the code below). I am drawing a border around an image in a UIImageView subclass (containerView). The Core Graphics code for this is located inside drawInRect: in the subclass. The Core Animation transition is a flip, however when it is drawn, the Core Graphics code is not used, i.e. drawIn...

Can you animate a height change on a UITableViewCell when selected?

I'm using a UITableView in my iPhone app, and I have a list of people that belong to a group. I would like it so that when the user clicks on a particular person (thus selecting the cell), the cell grows in height to display several UI controls for editing the properties of that person. Is this possible? ...

iPhone SDK: After a certain number of characters entered, the animation just won't load...

Okay, this is the code: [lblMessage setText: txtEnter.text]; [lblMessage sizeToFit]; scrollingTextView.contentSize = lblMessage.frame.size; float width = (lblMessage.frame.size.width) + (480); [UIView beginAnimations:@"pan" context:nil]; [UIView setAnimationDuration:durationValue]; [UIView setAnimationRepeatCount:5]; scrollingTextView...

CALayer flickers when drawing a path

I am using a CALayer to display a path via drawLayer:inContext delegate method, which resides in the view controller of the view that the layer belongs to. Each time the user moves their finger on the screen the path is updated and the layer is redrawn. However, the drawing doesn't keep up with the touches: there is always a slight lag i...

How do you explicitly animate a CALayer's backgroundColor?

I'm trying to construct a CABasicAnimation to animate the backgroundColor property of a Core Animation CALayer, but I can't figure out how to properly wrap a CGColorRef value to pass to the animation. For example: CGColorSpaceRef rgbColorspace = CGColorSpaceCreateDeviceRGB(); CGFloat values[4] = {1.0, 0.0, 0.0, 1.0}; CGColorRef red =...

Tips for reducing Core Animation memory usage

So here's the situation: I have a CALayer that is the size of my screen, and I'm setting the contents property to a 2 Mb JPEG that's roughly 3500 x 2000 pixels in size with a resolution of 240ppi. I'd expect there to be a slight overhead involved in using the CALayer, but my sample application (which only does exactly what's above) sho...

Halting In Progress CAKeyframeAnimation

I'm animating a UIView's frame property using a CAKeyframeAnimation on the view's CALayer and animating the "position" property. I'd like to be able to halt the animation at it's current state when the user taps the screen, but I'm unable to do so. I can halt the animation easily enough by calling [view.layer removeAnimationForKey:kFra...