Re: Resizing NSView with CABasicAnimation
Re: Resizing NSView with CABasicAnimation
- Subject: Re: Resizing NSView with CABasicAnimation
- From: Michael Fey <email@hidden>
- Date: Wed, 16 Apr 2008 09:43:24 -0400
Bill,
Given that you've "written the book" on Core Animation, I really
appreciate your insights. Since my view is layer backed (I called
setWantsLayer:YES on a parent view), then my call to [[self layer]
addAnimation...] should be [self addAnimation] instead? The other
thing that I'm not sure about is the NSString values that I'm passing
in for animationWithKeyPath: and addAnimation:forKey:. Do those look
correct for resizing the view?
Scott,
Your suggesstion to do away with the explicit animation is a good one,
so let me explain my reasons for using it: I am trying to chain
together a series of animations and I don't want one to happen before
the previous one has finished. By using a CABasicAnimation I can
specify a delegate (in this case my NSView subclass) that has the
animationDidStart and animationDidEnd methods. Using these delegate
methods I intended to control the series of animations. If there is a
better way of waiting for one animation to finish before starting
another one I am all ears, especially if I can do it with implicit
animations.
Thanks to both of you,
Michael
On Apr 16, 2008, at 1:02 AM, Scott Anguish wrote:
On Apr 15, 2008, at 11:01 PM, Bill Dudney wrote:
Hi Michael,
Are you layer backed or layer hosting (i.e. did you se the layer
explicitly?) If you are layer hosting then add he explicit
animation to the view instead of the layer (when layer backing you
should not manipulate the layer directly).
I don't think it matters. If he's trying to resize the view, the
layers aren't relevant. this can be done trivially through the
view's animator with or without layer backing/layer hosting/ being on.
If you are doing layer hosting then try leaving the 'from' and 'to'
values out.
_______________________________________________
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