Hi,
I feel I'm probably missing a few basic concepts of view animations.
Currently I have a bunch of subviews arranged in something like a
custom collection view. I want to animated a movement to a different
position and when that's done, remove invisible ones.
The straightforward way of animating works, it is pretty similar to
the AnimatingViews sample:
for( NSView *aView in views )
{
[[aView animator] setAnimations:nil];
NSPoint origin = [aView frame].origin;
origin.y += offset;
[[aView animator] setFrameOrigin:origin];
}
Now I try to get the removing part - it looks like explicit animations
with animation delegate allow removing the views once the animation
completes.
However, the following and obvious variants have no visible result:
for( NSView *aView in views )
{
[[aView animator] setAnimations:nil];
CABasicAnimation *animation = [aView
animationForKey:@"frameOrigin"]; // returns for all vies the same
animation!?!
NSPoint origin = [aView frame].origin;
origin.y += offset;
animation.toValue = [NSValue valueWithPoint:origin]; // setting
fromValue makes no difference
[[aView animator] setAnimations:[NSArray
arrayWithObject:animation]]; // no effect on the view
}
What am I missing?
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]