• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
View animator, how to do explicit animations / animation groups?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: View animator, how to do explicit animations / animation groups?
      • From: Matt Long <email@hidden>
  • Prev by Date: Message stack limitations
  • Next by Date: Re: Message stack limitations
  • Previous by thread: Re: Message stack limitations
  • Next by thread: Re: View animator, how to do explicit animations / animation groups?
  • Index(es):
    • Date
    • Thread