How do I access the presentation layer?
I would like to apply transform (rotation) to UIImageView
. I could just set a property transform
for the view, but wouldn't set the layer transform
to make it faster? If so, how can I achieve this?
Assuming I have UIImageView
it initialized with an image, can anyone help? Wouldn't it be better to have UIVIew
with UIImageView
in it?
You can do constant rotation with CAAnimation, which automatically repeats (I guess I haven't actually tried to do this exact thing, but similar stuff).
If one animation doesn't do that, of course, there will be two (one 180 ° rotation, and then when it's finished, you have another fire to make the second 180 °. This can be done either in the view or on its layer. You will definitely want to test this on a device for performance.
You don't need to use NSTimer; this is what CoreAnimation is built for.
source to share