• 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: Group CGAffineTransform Animations?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Group CGAffineTransform Animations?


  • Subject: Re: Group CGAffineTransform Animations?
  • From: WT <email@hidden>
  • Date: Wed, 17 Jun 2009 23:48:41 +0200

On Jun 17, 2009, at 11:28 PM, David Duncan wrote:

On Jun 17, 2009, at 1:58 PM, WT wrote:

my understanding was that the OP wanted to do all three operations concurrently. Of course, if he wants simply to move, then scale, and then rotate, there are easier ways to accomplish that than to use transforms.

You can set the center & transform of a view within the same animation block and both animations will occur concurrently.

Yes, of course! Duh... in my haste to answer, I misunderstood what you said in your previous post. Your comment provides the clearest and cleanest solution:


    CGRect screenBounds = [[UIScreen mainScreen] bounds];
    CGPoint screenCenter = { CGRectGetMidX(screenBounds),
                             CGRectGetMidY(screenBounds) };

    [UIView beginAnimations: nil context: NULL];
    [UIView setAnimationDuration: kAnimDuration];
    [UIView setAnimationDelegate: self];
    [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];

CGAffineTransform transform;
transform = CGAffineTransformMakeScale(kScaleX, kScaleY);
transform = CGAffineTransformRotate(transform, DEGS_TO_RADS(kAngleInDegrees));
imgView.transform = transform;


    imgView.center = screenCenter;

    [UIView commitAnimations];

For future reference and for the benefit of the OP, I've now updated my sample project.

Wagner
_______________________________________________

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


References: 
 >Group CGAffineTransform Animations? (From: Chunk 1978 <email@hidden>)
 >Re: Group CGAffineTransform Animations? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Group CGAffineTransform Animations? (From: Chunk 1978 <email@hidden>)
 >Re: Group CGAffineTransform Animations? (From: Chunk 1978 <email@hidden>)
 >Re: Group CGAffineTransform Animations? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Group CGAffineTransform Animations? (From: Chunk 1978 <email@hidden>)
 >Re: Group CGAffineTransform Animations? (From: Chunk 1978 <email@hidden>)
 >Re: Group CGAffineTransform Animations? (From: David Duncan <email@hidden>)
 >Re: Group CGAffineTransform Animations? (From: WT <email@hidden>)
 >Re: Group CGAffineTransform Animations? (From: David Duncan <email@hidden>)

  • Prev by Date: Re: Group CGAffineTransform Animations?
  • Next by Date: Re: Group CGAffineTransform Animations?
  • Previous by thread: Re: Group CGAffineTransform Animations?
  • Next by thread: Re: Group CGAffineTransform Animations?
  • Index(es):
    • Date
    • Thread