Alright, I got something now that I believe works.

*let transform:CATransform3D = innerRing.layer.presentation()!.transform*
*let angle: CGFloat = atan2(transform.m12, transform.m11)*
*var testAngle = radiansToDegress(radians: angle)*
*if testAngle < 0 {*
*    testAngle = 360 + testAngle*
*}*
*print("final: \(testAngle)º")*

Seems to be spot on.


On Tue, Mar 14, 2017 at 11:41 PM Eric E. Dolecki <edole...@gmail.com> wrote:

> I don't follow.
>
> On Tue, Mar 14, 2017 at 11:29 PM Graham Cox <graham....@bigpond.com>
> wrote:
>
> 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 <edole...@gmail.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to