I have a project where I have to rotate a large image under the users thumb, it represents a dial the use turns to select a day of the year. I am currently using CGContextRotateCTM() and -[UIImage drawInRect:] but the performance on retina display iPads is not good, ironically on pre-retina iPads is works fine (only a 1/4 of the pixels to push around). I have don everything I can to optimise my code, instruments shows me that 87% of the time is in -[UIImage drawInRect:]. Does anybody have any hints on how to get some significant performance improvement, should I be looking a CALayers and rotating them instead.
Share
Put the image in its own
UIImageViewand set the image view’stransformproperty to your rotation transform. That will be much, much faster than drawing the image into aCGContextwith a rotated CTM.