Re: Getting the true rotation of a UIView layer
Re: Getting the true rotation of a UIView layer
- Subject: Re: Getting the true rotation of a UIView layer
- From: Graham Cox <email@hidden>
- Date: Wed, 15 Mar 2017 14:29:52 +1100
Get the final transform, then use it to transform an angle of 0. The result is the angle.
—Graham
> On 15 Mar 2017, at 2:13 PM, Eric E. Dolecki <email@hidden> wrote:
>
> Once done (I dispatch after the randomSpeed duration), I'd like to
> determine the angle it's currently at.
>
> *let transform:CATransform3D = innerRing.layer.transform*
> *let angle: CGFloat = atan2(transform.m12, transform.m11);*
> *print(angle)*
>
> Always prints 0.0
>
> Am I missing something obvious? I almost thought about using hitTest but
> there must be a way to get this after each spin?
>
> Thank you,
> Eric
_______________________________________________
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