• 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
Re: iPhone: CATransition done (get the key?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iPhone: CATransition done (get the key?)


  • Subject: Re: iPhone: CATransition done (get the key?)
  • From: Fritz Anderson <email@hidden>
  • Date: Wed, 13 Jan 2010 10:43:53 -0600

On 13 Jan 2010, at 8:44 AM, Eric E. Dolecki wrote:

> Currently I am using CATransition to display a subview:
>
> [window addSubview:monthView.view];
>
> CATransition *animation = [CATransition animation];
>
> [animation setDuration:0.25];
>
> *[animation setDelegate:self];*
>
> [animation setType:kCATransitionPush];
>
> [animation setSubtype:kCATransitionFromLeft];
>
> [animation setTimingFunction:[CAMediaTimingFunction
> functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
>
> [[monthView.view layer] addAnimation:animation forKey:@"fadeIn"];
>
>
> So that delegate opens up a callback for animationDidStop:
>
> - (void)animationDidStop:(CAAnimation *)theAnimation finished: (BOOL)flag {
>
> However I also have a method to dismiss a subView using CATransition - and
> the same callback is called. How can I determine what the *key* is in the
> animationDidStop? I basically just need to determine in what context the
> animationDidStop is being called.
>
> Thanks for any pointers. Continuing to Google.

Do I understand correctly that you want to know which animation the animationDidStop:finished: refers to? Why not use the theAnimation parameter? You can retain a reference to your two animations and do

if (theAnimation == dismissAnimation)

to choose the proper action.

BTW, terminology nit: "Delegate" refers to the object responding to the callback methods, not to any action of a delegate, object using a delegate, or any occurrence of setting a delegate object.

	— F

_______________________________________________

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: iPhone: CATransition done (get the key?)
      • From: "Eric E. Dolecki" <email@hidden>
References: 
 >iPhone: CATransition done (get the key?) (From: "Eric E. Dolecki" <email@hidden>)

  • Prev by Date: Problem printing offscreen PDFViews
  • Next by Date: Re: Scaled NSImage size of NSImageView?
  • Previous by thread: iPhone: CATransition done (get the key?)
  • Next by thread: Re: iPhone: CATransition done (get the key?)
  • Index(es):
    • Date
    • Thread