tags:

views:

54

answers:

1

It's quiet complicated. I have four UIViews.

viewA acts as root container. viewB and viewC are childs of viewA. So viewA contains viewB and viewC.

viewD is a child of viewB.

I try to "draw" it for you:

viewA OWNS ((viewB OWNS viewD) && viewC)

I rotate the layer's transform.rotation.z of viewB. So viewB is rotated a little bit. ViewD is also rotated a little bit relative to viewB.

Also, I rotate viewC the same way with an other value. So both viewB and viewC are rotated differently relative to viewA. viewD is rotated a little bit relative to viewB.

I need to convert all these coordinate systems in such a way, that the rotation of viewC can be specified relative to viewD. Or in other words: In such a way, that when the transform.rotation.z of viewC is the same as from viewD, both views appear to be rotated the same way (visually on screen).

A few weeks ago I was reading in some paper that UIKit provides support for converting coordinate systems. Any idea if they're suitable to fix this problem?

A: 

It sounds like you want viewD's transform to be independent of viewB? If so, make viewD a subview of viewA (if it's a later sibling than viewB, it will appear on top of it).

hatfinch
That would be fine, but when I rotate viewB, viewD must be rotated exactly the same way with no delay. That's why viewD is a subview of viewB. I didn't mention that there are 5 "copies" of viewD with different rotations. But all of them must rotate together with viewB.
HelloMoon
If rotating viewB will lead to rotating viewD, then it must also lead to rotating viewC, because you want viewC's rotation and viewD's rotation to be equal. Or am I misunderstanding?
hatfinch