core-animation

Trying to make a card from CALayers that can flip over

I've been trying to develop a CALayer based "CardView" object that has two layers that face away from each other to present the two sides of a card. I've been working with things like the doublesided property of the CALayer and find the results to be confusing. My base class is CALayer and I'm adding two sublayers to it, one with a M_P...

Mixing CGLayers and CALayers

Here's the setup: I have a NSView which is a CALayer-backed view, and contains many CALayers. I have a CALayer for the 'background' of the view, and many small CALayers which are sublayers. Sometimes this view can be very big (as large as 2560x1400), and when it does there is a very noticeable lag in the CALayers. My guess is that Core ...

CALayer memory usage on draw - implicit cache?

Hello everyone. I'm having a peculiar problem with CoreGraphics/CoreAnimation on the iPhone. To better explain how the problem manifests itself, I'll walk you through my current setup and illustrate with code where appropriate. I'm trying to draw a bunch of preloaded images in a UIView's CALayer, but whenever the image displays, the ap...

UIView shake animation

Hi, i'm trying to make a UIView shake when a button is pressed. I am adapting the code I found on http://www.cimgf.com/2008/02/27/core-animation-tutorial-window-shake-effect/. However, by trying to adapt the following code to shake a UIView, it does not work: - (void)animate { const int numberOfShakes = 8; const float duration...

Best Way to Perform Several Sequential UIView Animations?

I have a series of 8 UIView animations that occur directly after my view is loaded. Right now, I am accomplishing this by using the animationDidStop:finished:context delegate method, and everything works as expected. The problem is that I have a new method for each animation. Most of the code in each of these methods is repeated, with on...

How to recreate the animation in the Notes iPad app?

When you use the Notes iPad app (from Apple) in landscape mode, you see the list of notes to the left. If you select a note you see a nice little animation that looks like someone is marking the note with a red pencil. I already have a graphic that looks like that red circle, but how do I animate it like that? Thank you in advance. Edi...

CABasicAnimation stops when relaunching the app

I am running into a problem where a restart of my iPhone app causes animations to stop. More specifically, I have the following animation set and running: CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"]; animation.duration = 1.0; animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTim...

What is a good book for learning Core Animation?

I want to learn how to use core-animation for the iPhone in a more serious manner; instead of just ripping other people's code to move a box a few pixels, I want to be able to write that code myself, and engage in translation, transformation, and other things with an understanding of the code I'm using to achieve it. Unfortunately, the ...

Stop drawing of CATiledLayer

Is is possible to stop CATiledLayer to draw (drawLayer:inContext)? It draws asynchronously and when i try to release CGPDFDocumentRef, which is used by CATiledLayer, the app crashes (EXC_BAD_ACCESS). That's my view: @implementation TiledPDFView - (id)initWithFrame:(CGRect)frame andScale:(CGFloat)scale{ if ((self = [super initWithF...

Is there a good rule of thumb to help decide when it is appropriate to use Quartz 2D v. Core Animation v. OpenGL in an iPhone/iPad app?

I'm looking for is a heuristic for determining which of the primary graphics methods for iPhone/iPad development would be the most appropriate solution for a given problem. ...

Why is my animation flickering on iPhone?

I'm getting random flickers from the following animation -- it looks like the picture is centering itself for about 1 frame or so before continuing with what it's supposed to be doing, and I don't know why. -(void)generateWander{ //NSLog(@"generateWander"); if(targetChange==0) { targetChange=TARGET_LENGTH+1; float destinationAn...

What is the best way to animate many images?

I can not animate many images with animationImages and startAnimating as it uses too much memory and crashes. What is the best way to animate 100 images in a portion of my iPhone screen (not full screen)? Is there an example? ...

Difference between [UIView beginAnimations:context:] and [UIView animateWithDuration:animations:]

It appears to me these two class methods are not interchangeable. I have a subview of UIView with the following code in the touchesBegan method: if (!highlightView) { UIImageView *tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Highlight"]]; self.highlightView = tempImageView; [tempImageView release]...

iPhone Core Animation not Running Smoothly ?

Hi all, I have the following core animation code in my app : -(void)startCoreAnimation [UIView beginAnimations:@"IconFade" context:Icon]; [UIView setAnimationCurve:UIViewAnimationCurveLinear]; [UIView setAnimationDuration:1]; [UIView setAnimationRepeatAutoreverses:YES]; [UIView setAnimationDelegate:self]; [UIView ...

ObjC - UIViews: animating view and subview independently?

Hi! I have an UIView and its subview. When I animate myView (size.x+20) my subview is being animated too, however I want to translate my subview at the same time independently(origin.x-40) (without the subview moving because of the resizing of myView). I was able to do it by adjusting the translations (or better position, because I mig...

iphone: creating the 'blue bubble contacts' effect in ComposeEmail?

Hi, I want to create an effect similar to the 'blue bubble tag' effect in the Compose Email Page where the recipients email address appears. I need to design a similar effect to allow users to create 'tags' for a picture.. Do I have to use Core Animation for this? Can someone please give me some pointers on where / what i need to use? ...

animations on infinite loop

I have 5 different animations that animate then disappear one after another. Is there a way to put them on an infinite loop so animation #1 begins and ends, then anim #2 begins and ends etc..? the whole process then would repeat on an infinite loop. I have the animations in separate blocks on delays. I'm guessing that there is a better ...

Core Animation and drawRect:

Hello, I have a UITableViewCell drawn using drawRect:. I'm drawing an shape in drawRect and would like to animate this shape (using some parameter) when using the cell goes into edit mode. However, I couldn't find how to use animated parameters within drawRect. Could someone point me to the right documentation or is it impossible? Tha...

Create a grouped tableview with gradient on its border

Hey everybody, I need to create a grouped tableview with gradient on its border (not on its cells). I made some research on the web but I'm not sure I understand how to proceed. A little help could really unblock me in my project :). Thanks ...

UIView infinite loop Animation to call a method after every repeat cycle

I am at my wits end trying to come up with a design pattern for this paradigm. I haven't had much luck on this site but at this stage I'll try anything. I am trying to implement a radar type animation and hence I am rotating a view 360 degrees to represent the radius rotating around the circle. I have placed points around this circle an...