• 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
Coordinating animation of layers with a UIView animation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Coordinating animation of layers with a UIView animation


  • Subject: Coordinating animation of layers with a UIView animation
  • From: Roland King <email@hidden>
  • Date: Tue, 06 Nov 2012 21:09:24 +0800

I have a UIView which frame I am animating to a new location/size using [ UIView animateWithDuration:animations ]. The view's layer has a custom sublayer which it's laying out either in layoutSubviews or layoutSublayersOfLayer:, either seems to work. That sublayer is also moving to a new position depending on the new UIView bounds. What I want is the two animations to go together, using whatever the duration set in the UIView's animateWithDuration:animations: call because that is the point at which I know how long the animation needs to be.

The only way I've found to do this so far seems really hacky, to nest a CATransaction within the UIView animation and give them the same time, is there a better way to accomplish something like this?

	NSTimeInterval interval = 2f;

	[ UIView animateWithDuration:interval animations:^{
		[ CATransaction begin ];
		[ CATransaction setAnimationDuration:interval ];
		self.faceView.frame=faceViewFrame;
		[ CATransaction commit ];
	} ];

_______________________________________________

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: Coordinating animation of layers with a UIView animation
      • From: Luke Hiesterman <email@hidden>
  • Prev by Date: Re: a way to clear inactive RAM
  • Next by Date: Re: Coordinating animation of layers with a UIView animation
  • Previous by thread: Re: Harnessing Perl Scripts within a Project
  • Next by thread: Re: Coordinating animation of layers with a UIView animation
  • Index(es):
    • Date
    • Thread