core-animation

Animating UINavigationBar

I want to slide the right button and the title in and out (instead of having things just appear and disappear). How can I go about doing this? ...

Core Animation Layer Rotation on the left side?

Hi, With the following code I'm able to rotate the layer based on the left side. But how can I rotate it based on the right side? Thank you, Jose. CALayer *layer = [masterTasksLeftSideView layer]; [layer removeAllAnimations]; CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"]; CATrans...

Partial pdf page rendering on CATiledLayer

I'm using CATiledLayer to render a heavy pdf page inside a UIScrollView that is used to handle zooming and spanning.. The method below is called every time a Tile need to be drawn and I regret that I have to paint the whole pdf every time. I hope that behind the scene the CATiledLayer only render the part that it needs but nothing is l...

Core animation animationDidStop with chained animations

I have two animations in a custom UIView, anim1 and anim2. Anim1 sets its delegate to self and there is an animationDidStop method in my class which triggers Anim2. If I want something else to occur when Anim2 finishes, how do I do this? Can I specify a delegate method with a different name? UPDATE I declare two animations as iVars: C...

PDFView (PDFKit) not displaying with core animation layers turned on.

I'm doing a sort of kiosk app with a number of buttons that swap out the subviews in a window. There are about a half dozen subviews, all of which are NSViews. One of the subviews has in it a PDFView displaying a local PDF file. Without any core animation, everything works as expected. When I click the button corresponding to the PDF...

Core Animation difficulties with spinning dial control (very detailed)

Im trying to create a spinning dial control, basically a set of 6 digits that spin around and around to give the effect of a spinning number meter (similar to your power/water meters, or perhaps a poker machine, in fact very similar to the existing UIPickerView control, but with a completly different look and feel). So far, I almost hav...

Core Animation:Failed to allocate bytes. using core-plot on iPad

Hi guys, im new to iphone developing so please teach me on stuff that i may miss out. so basically i have graphview.m which creates a coreplotviewcontroller.view in this way CorePlotViewController *aCorePlotViewController = [[CorePlotViewController alloc] initWithNibName:@"CorePlotViewController" bundle:nil]; aCorePlotViewControlle...

CAEAGLLAYER renderbuffer and UIView animation conflicting

I have a CAEAGLLAYER in a normal UIView created using: + (Class)layerClass { return [CAEAGLLayer class]; } I have a method - (void)renderExistingPointsFromModel That gets points from a database and renders it by presenting the renderbuffer at the end. A parent controller calls this method by: [drawingCanvasView renderExistingPoi...

How to loop through core animation sublayer array and apply animations in sequence

Hi, I want to animate through an array of CATextLayers, one after the other. The layers are created and added in a loop. I need to the animation to work like a flip book. Up to now, as a proof of concept, I have Used CABasicAnimations but in order to animate multiple layers in sequence, I think I need one of the other Core Animation opt...

Convert CGPoint between iPhone & CA planes

I have a UIView subclass that I'm drawing a PDF onto (using a CATiledLayer). I also need to draw on a specific region of that PDF, however the coordinate plane of the CATiledLayer when using CG to draw is way screwy. See image: I have a point (200,200), that I need to convert to the CATiledLayer's coordinate system, which is the 2nd ...

What is a CALayer?

What is a CALayer (as seen in the layer property on a UIView) and where would we use such a class? ...

How to make UIView animation callback on reverse?

I've been trying to make a short animation that reverses halfway through with a static method that can be called by my view controllers. This works fine. But I need it to perform a selector when the reverse takes place, essentially in the middle of the animation. The method setAnimationDidStopSelector only fires when the entire animati...

Deadlocks: How do you determine if a call may cause unsafe painting off of the main thread for iOS?

Drawing/painting should always be done on the GUI thread otherwise deadlocks can occur!... How do you determine if a call may cause unsafe painting off of the main thread for iOS? The problem is we get stacks like this which are not on the main thread... #19 0x02a788d2 in -[CALayer drawInContext:] #20 0x02a784b0 in backing_callback #2...

Calling setNeedsDisplay:YES on layer-hosting view does not redraw the view

I have a layer-hosting view set up like this in a custom NSView subclass: [self setLayer:rootLayer]; [self setWantsLayer:YES]; I add all the sublayers to the layer tree after I called setNeedsDisplay on each sublayer. Each layer's content is provided by a drawLayer:inContext method of my layer's delegate. Here is my problem: After i...

Animate a spinning cube after touch event - iPhone objective c

I have a UIViewController implementation which builds a core image cube and rotates it while there are touches events occuring. It has the following methods: initController touchesBegan touchesMoved touchesEnded continueSpinning I am trying to continue rotating the cube after the touchesEnded fires for an amount of time (say 2 sec...

How do I rotate a CAGradientLayer by 180 degrees?

I have created a CAGradientLayer for my custom UIButtons. The code for creating it is as follows: CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.frame = btn.bounds; gradient.cornerRadius = 10.0f; locations=[[NSArray alloc] initWithObjects: LOC_0, LOC_5, LOC_51,LOC_1, nil]; [gradient setLocations:locations]; colorNext=[...

Cocoa: How do you make the background of an IKImageBrowserView transparent?

How do you make the background of an IKImageBrowserView transparent? There seems to be no background color option in interface builder. What I've tried: I've never used Core Animation, but I saw IKImageBrowserView has a setBackgroundLayer method, so I tried the following, which had no effect: CALayer* layer = [CALayer layer]; [layer...

Core Animation: Running and Moving Animation

Hi, I have a sequence of images that I would like to animate. I am using the CAKeyframeAnimation class to run the animation. Here is the relevant part of the code: [keyAnimation setValues:arrayOfImages]; [keyAnimation setCalculationMode:@"discrete"]; keyAnimation.fillMode = kCAFillModeForwards; keyAnimation.removedOnC...

Continuos animation with Core Animation

Hi I want to perform a simple rotation with core animation using this code: [UIImageView beginAnimations:nil context:nil]; [UIImageView setAnimationDuration:1]; [UIImageView setAnimationRepeatCount:5]; CATransform3D rotationTransform = CATransform3DIdentity; rotationTransform = CATransform3DRotate(rotationTran...

Layer animation works fine first time, but not on second identical invocation

I have an animation that works perfectly on the first invocation. But if I want to animate the very same layer again, using the same code, it completes immediately and the animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag is invoked on the delegate with the flag value NO. Here is the code that adds the animation: imag...