From the UIView Class Reference:
The UIImageView class is optimized to draw its images to the display. UIImageView will not call drawRect: a subclass. If your subclass needs custom drawing code, it is recommended you use UIView as the base class.
At present, UIImageView
subclasses do work, especially if they don't interfere with the drawing code. Just don't complain to apple if a future iOS update breaks your subclass. It's easy enough to write your own UIView subclass to display an image. If you already have an appropriate graphics, consider just placing it in CALayer
contents
, instead of implementing the UIView drawRect
method.
Rotations by changing UIView transform
(which is of type CGAffineTransform
) always take the shortest path. This means that a clockwise rotation of 270 degrees is animated as an anticlockwise rotation of 90 degrees, and any multiple of 360 degrees will do nothing. You can get 360 degree rotations if you obtain the view's layer, and animate CALayer transform
(which is of type CATransform3D
). See Can I use CGAffineTransformMakeRotation to rotate a view more than 360 degrees?
To make the animation repeat endlessly, the CAMediaTiming Protocol Reference recommends setting repeatCount
to HUGE_VALF
.