Re: CALayer: Animation using actions property
Re: CALayer: Animation using actions property
- Subject: Re: CALayer: Animation using actions property
- From: "Bhatnagar, Arvin" <email@hidden>
- Date: Tue, 19 Apr 2011 08:39:37 -0400
- Acceptlanguage: en-US
- Thread-topic: CALayer: Animation using actions property
I fixed my own issue.
It has to do with the timer. In short when using a timer to animate a
layer I was using scheduledTimerWithTimeInterval versus
timerWithTimeInterval. When I use timerWithTimeInterval I then set the
Fire Date and add the timer to three modes: (NSRunLoopCommonModes,
NSDefaultRunLoopMode, NSEventTrackingRunLoopMode). Now when I resize my
view the timer doesn't stall and the animation continues.
This worked for me, and I can only assume that adding the timer to these
other two modes was the solution: NSRunLoopCommonModes /
NSEventTrackingRunLoopMode.
If anybody can explain this further, I am all ears!
Thanks,
Arvin
On 4/18/11 10:49 PM, "Bhatnagar, Arvin" <email@hidden>
wrote:
>Hi All,
>
>This is probably a simple question for someone other than I.
>
>I have a very simple CALayer which is a simple plain layer with a white
>background. I then create a CABasicAnimation and add it to the actions
>property to animate the @"opacity". From here I setup a timer to fire and
>toggle the opacity between 0 and 1 which animates.
>
>My issue is, when I go to resize the window the animation halts. Anybody
>know why this occurs and if I can allow the animation to continue even if
>I resize the view that the layer resides in? It's probably something
>small and simple, but just don't know what it is and can't find it in the
>documentation.
>
>Oh yeah, my later tree is setup as such:
>
>[CALayer rootLayer]
>[view setWantsLayers:YES]
>[[view layer] addSublayer:mBasicLayer]
>
>Thanks,
>Arvin
>_______________________________________________
>
>Cocoa-dev mailing list (email@hidden)
>
>Please do not post admin requests or moderator comments to the list.
>Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
>Help/Unsubscribe/Update your Subscription:
>.com
>
>This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden