Any quick and dirty anti-aliasing techniques for a rotated UIImageView?

The edges of CoreAnimation layers aren’t antialiased by default on iOS. However, there is a key that you can set in Info.plist that enables antialiasing of the edges: UIViewEdgeAntialiasing.

https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html

If you don’t want the performance overhead of enabling this option, a work-around is to add a 1px transparent border around the edge of the image. This means that the ‘edges’ of the image are no longer on the edge, so don’t need special treatment!

Leave a Comment