View animator, how to do explicit animations / animation groups?
View animator, how to do explicit animations / animation groups?
- Subject: View animator, how to do explicit animations / animation groups?
- From: Thomas Engelmeier <email@hidden>
- Date: Wed, 3 Sep 2008 12:41:46 +0200
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 (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