Re: How to (slowly) rotate a view
Re: How to (slowly) rotate a view
- Subject: Re: How to (slowly) rotate a view
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Mon, 06 Aug 2012 00:34:45 +0700
On 6 Aug 2012, at 00:20, Kyle Sluder wrote:
> On Aug 5, 2012, at 10:11 AM, "Gerriet M. Denkmann" <email@hidden> wrote:
>
>> I use this code (iOS 5.1):
>> CGAffineTransform m = { c, +s, -s, c, 0, 0 }; // rotation, s = sin(angle), c = cos(angle)
>> CALayer *layer = self.view.layer; // view is UIView, self is subclass of UIViewController
>> [ CATransaction begin];
>> [ CATransaction setAnimationDuration: 9 ];
>> [ layer setAffineTransform: m ];
>> [ CATransaction commit];
>> The view rotates ok, but does it instantly, instead of taking 9 seconds.
>>
>> What am I doing wrong?
>
> What happens if you use the transform property instead of setAffineTransform:?
I tried instead:
// opacity is 0.5
[ CATransaction begin];
[ CATransaction setAnimationDuration: 9 ];
layer.opacity = 1;
[ CATransaction commit];
[ CATransaction begin];
[ CATransaction setAnimationDuration: 9 ];
layer.opacity = 0.5;
[ CATransaction commit];
but I only see the resulting opacity of 0.5.
The view controller is a child of another view controller. The view is subview of another view.
Gerriet.
_______________________________________________
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