core-animation

simple CATextLayer scaling problem

I'm having a simple scaling problem with CATextLayer, but i just couldn't figure it out: I want the CATextLayer to proportionally grow in size with it's superlayer: if the superlayer's width is 300 the text size of CATextLayer should be 12 and if the supeview's width is 600 the text size should be 24. I couldn't find a working solution! ...

I would like to flip my app's splash screen - how can I mimic the flipside controller's animation?

I've finally gotten a working "alpha" version of my first app installed and (mostly) working on my iPhone 3G. So excited I came into the house and danced a little jig while my wife rolled her eyes at me. Don't care - totally stoked that I figured it out on my own (with lots of help here - thanks again, guys). I've never really dabbled w...

CATiledLayer: Determining levelsOfDetail when in drawLayer

I have a CATiledLayer inside a UIScrollView and all is working fine. Now I want to add support for showing different tiles for three levels of zooming. I have set levelsOfDetail to 3 and my tile size is 300 x 300. This means I need to provide three sets of tiles (I'm supplying PNGs) to cover: 300 x 300, 600 x 600 and 1200 x 1200. My pr...

How to create an own animation timing function?

In UIView animation blocks I can specify timing curves like UIViewAnimationCurveEaseOut and so on. Is there a way of providing an own timing function to core animation, which behaves different from the defaults? ...

Blur CALayer's Superlayer

Hi. I've got a CALayer and a sublayer in it. What i want to achieve is a blur of the superlayer (the area under the sublayer), just like the standard sheets do it. I've tried to set a .compositingFilter on the sublayer but this doesn't seem to work. Any ideas how to solve this? Code from the sublayers init: CIFilter *blur = [CIFilter...

addSublayer vs addSubView which is more efficient?

I have 5 UIImageViews for displaying 5 images. For my app, I need swap the order of them depending on some events. I achieve this by calling: [anImageView1 removeFromSuperview]; [self.view insertSubview:anImageView1 aboveSubview:anImageView2]; Recently, I've come across a different method for doing this using 1 UIView and 5 UIImageVie...

iPhone UISearchBar animated to top

There are lots of apps where the searchbar moves upwards if active and moves down when it is inactive. There is a sample code from apple available which works with IB, but how can I achieve this behavior programmatically? Mostly it is combined with a navigationbar which moves out of the screen in replace with the searchbar ...

How do I stack images to simulate depth using Core Animation?

I have a series of UIImages with which I need to simulate depth. I can't use scaling because I need to be able to rotate the parent view, and the images should look like they're stacked visibly in front of each other, not on the same plane. I made a new ViewController-based project and put this in the viewDidLoad (as well as attached t...

Does Core Animation provide public APIs for iBook style page curl page transitions?

Does Core Animation provide public APIs for iBook style page curl page transitions? I have seen this blog post - http://bit.ly/dh5gxX - which is an almost exact re-engineering of iBook page-curl transitions but it relies on private APIs. Is there in fact a public version and if not is there something in open source? Thanks, Doug ...

Fluid iPhone Animation ala Plants vs Zombies

If you've played Plants vs Zombies, you've seen how fluid and remarkable the character animation is. Can anyone assume how they are doing this? They don't seem to simply be animating bitmaps; the animation is too crisp, even as characters rotate and scale. The artwork looks vector, but I can't imagine that everything is drawn out using C...

How do I perform a flip and grow animation like in iPhoto 09?

I'm developing a Cocoa application and want to be able to click a button in one of the views in my NSCollectionView and have a details view flip open and position to the middle of the screen like it does in iPhoto 09 when you click the "i" in the bottom-right hand corner of a photo. The photo "flips" and grows, centered on the window to...

Manually fade in a newly added subview?

I want a view to fade in when being added to the stack via [self.view addSubview:someSecondaryViewController.view]; How do I animate this call so that the view fades in (and out)? ...

iPhone imageView layer masksToBound leads to slow scrolling

I have a UITableView with about 30 cells, 5 are viewable at a time. In each cell I have 2 UILabels and 1 UIImageView. I use a CALayer to render the image view with a rounded border. myImageView.layer.masksToBounds = YES; myImageView.layer.cornerRadius = 2.5; myImageView.layer.borderWidth = 1.0; myImageView.layer.border...

Improving the efficiency of multiple concurrent Core Animation animations

I have a view in my app that is very similar to the month view in the built-in Calendar app. There's a subview that holds the individual cells (a custom UIView subclass that draws text into its layer), and when the user navigates to the next "month", I create the new cells and slide the view to show them. When the animation stops, I remo...

Horizontal page curl in iPhone - I have - But Valid ?

Hello ! Every one. I was googling for applying horizontal page curl in iPhone. I also tried this, but it wasn't appropriate for me (To change orientation & work in different ori.). I tried to google more. Finally I got a link or link . From Where, I could Understand the horizontal page curl. But when I went to code deeply, I found some...

Can't build iphone project in xcode with CATRansform3DMakeRotation

Hi, I need to use CATRansform3DMakeRotation function in my project, but when I try to compile I get an build error Undefined symbols: "_CATransform3DMakeRotation", referenced from: if I comment the function out the project builds fine. Any ideas why is this happening? ...

How to group two CABasicAnimation animations and kick them off at the exact same time?

I know there is some kind of animation grouping mechanism in core animation. So lets say I have two CABasicAnimation firstAnimation and secondAnimation. How would I group these and how would I kick off the group to start animating? ...

How to animate the frame of an layer with CABasicAnimation?

I guess I have to convert the CGRect into an object to pass it to fromValue? This is how I try it, but it doesn't work: CABasicAnimation *frameAnimation = [CABasicAnimation animationWithKeyPath:@"frame"]; frameAnimation.duration = 2.5; frameAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInE...

How to animate movement of a layer along a path?

Problem: I have a path which consists of line segments. For example, 4 long line segments form up a half circle around the whole screen. I want to animate an layer moving along this path. How would I do that, if I have a given CGPathRef? And how to tell where the starting point on the path actually is? ...

Is there any seriously good reason why a view can not completely manage itself?

Example: I have an warning triangle icon, which is a UIImageView subclass. That warning is blended in with an animation, pulses for 3 seconds and then fades out. it always has a parent view! it's always only used this way: alloc, init, add as subview, kick off animation, when done:remove from superview. So I want this: [WarningIcon ...