core-animation

Help with stock ticker style scrolling using Core Animation

Hi, I'm looking for some guidance on the best way to implement stock ticker style right-to-left scrolling of CALayers in Core Animation on OSX. I'm pretty new to Cocoa and don't know the best way to implement this. I have a continuous stream of news items and stock details that I turn into CALayers (made up of 1 image and a CATextLayer...

How can we get kCAOnOrderOut to work?

The Apple documentation claims that the Core Animation action key kCAOnOrderOut has one sole purpose: to animate a layer out of sight when it either becomes hidden or has -removeFromSuperlayer called on it. I'm only referring to the latter case in this question. In practice, when -removeFromSuperlayer is called, the layer is removed imm...

Nested CALayers not picking up perspective tranform

Hi, I'm trying to make use of CALayers to create a 3D style effect in one of my applications. However, it seems that nested CALayers do not have perspective applied to them. To illustrate with pseudo-code, if I have a layer with perspective applied like so: CATransform3D subLayerTransform = CATransform3DIdentity; /* set perspective */...

How can I detect a touch on an animated subview ? Or click an animated UIButton?

I have a view that is moving. The view is sometimes on and sometimes off screen - it is twice the width of the screen. In this view, there are buttons that I need to be able to click. I've tried doing this in many ways already - using pure buttons using touches began on UIView I'm doing the animation using a CGPath in core animation ...

Core Animation unwanted flicker artefact

Hi, I'm using some of the 3D effects in core animation and am noticing a very unpleasant flicker when some of my layers enter into positive territory on the zAxis (just around the point they go behind the "camera" i guess... is there anyway to resolve this? ...

How to animate the textColor property of an UILabel?

For some reason, when I try to animate textColor, it won't work. The textColor just suddenly changes from A to B. Is it possible to animate it, from lets say red to black? ...

How can I get a core animation Explicit animation to behave in exactly the same way as an Implicit animation?

I wish to do some custom animation using core animation but am having the (no doubt) classic problem of animations resetting when they have completed. Of course this can be stopped by using: [animation setFillMode:kCAFillModeForwards]; [animation setRemovedOnCompletion: YES]; However, I am then left with a layer that won't respond to...

Core Animation problem on iPhone

I'm new to iPhone development, and doing some experimentation with Core Animation. I've run into a small problem regarding the duration of the animation I'm attempting. Basically, Ive got a view with two subviews, and I'm trying to animate their opacity so that one fades in while the other fades out. Problem is, instead of a gradual fad...

iPhone: Animating a view when another view appears/disappears

I have the following view hierarchy UITabBarController - UINavigationController - UITableViewController When the table view appears (animated) I create a toolbar and add it as subview of the TabBar at the bottom of the page and let it animate in with the table view. Same procedure in other direction, when the table view disap...

How to achieve the same effect like the unlock slider in the welcome screen of iPhone OS?

I need to do something similar, where an animation highlights the text of a button to show that it must be slided to do something. Just like that unlock thing on the iPhone. How is that done? Is there a tutorial how to achieve this effect? ...

Reverse playback of a CATransform

I have an animation created with Core Animation for my UIImageView, but i would like to know if its possible to play the animation in reverse/backwards mode. Anyone got an idea? ...

Animating resizing and moving UIView at the same time

I'd like to "Stretch" a UIView to the right side, meaning increase it's frame.size.width by foo pixels and at the same time decreasing it's frame.origin.x by foo pixels, using [UIView beginAnimations] syntax. However, if I do that, when the animation begins the view immediately resizes, and then starts the animation for the origin. CGRe...

How to Anti-Alias Layers in iPhoneOS

We've had Reiner Knizia's Money out for a couple of months now. It's done pretty well, and so we've been updating it as time allows. However, one thing continues to bug me. I've never been able to get my layered cards to anti-alias correctly. Here's a sample: Cards that are laid straight are very clean, but whenever they're angled th...

How to specify selector when CAKeyframeAnimation is finished?

I'm using a CAKeyframeAnimation to animate a view along a CGPath. When the animation is done, I'd like to be able to call some other method to perform another action. Is there a good way to do this? I've looked at using UIView's setAnimationDidStopSelector:, however from the docs this looks like it only applies when used within a UIView...

Animations make my app crash: How can I remove them?

In my app, I create view controller objects as I need them. When a view controller goes away, I get rid of it by calling -removeFromSuperview on it's view and then set the retaining property to nil. That way my app uses very low memory all the time. But there's a problem: I have heavy animations going on in some view controllers, and ev...

Is the foobar:finished:context: method of UIView animations delegate really giving a BOOL for finished?

Althoug I read everywhere that the method signature has a BOOL for finished, I do never get a false. It is always true. And now the strange thing: When I NSLog that out with %d, it is always either 32 or 40. Other BOOLs I have are either 1 or 0. That makes no sense. So: Not a bool, right? What's that instead, really? ...

Core Animation Unwanted Text Sharpening.

Whenever I add a layer for Core Animation either from the nib or programatically, the NSTextFields (labels) in my interface get messed up. Here's a screenshot from Apple's BasicCocoaAnimations example. (Look at the text fields on the left, somehow they're drawn sharper than normal) Note that if I add a layer in IB then it also gets mess...

Border image on UIView

I want to have a UIView subclass that has a border image, but i dont want or care about this 'new' frame/bounds around the border image itself. What i wanted to do was just use drawRect and draw outside of the rect but all drawing is clipped and i dont see a way to not clip drawing outside of this context rect. So now i have added a su...

How to get UIScrollView contentOffset during an animation

I am trying to get the contentOffset property of a UIScrollView in the middle of a setContentOffset animation. Note I am not using the animated property of the method, but instead enclosing the setContentOffset operation within a UIView animation block so I can have finer control. When I try to read the value of contentOffset in the mid...

Flipping a Window in Cocoa

How can I flip an NSWindow so I can press a button, and the window will "flip" like on Dashboard and the content view of the NSWindow changes. ...