How to rotate a UIImage
09 Jan 2017
While I was developing a camera related iOS app I noticed you don’t have swift support to rotate a UIImage, so I wrote a small and useful extension.
Code
Usage
To use it you just need to copy/paste it in your project and you’ll have a new method for every UIImage instance.
Assuming you have the extension in your project, just call .rotated(byDegrees: X) to get the rotated image.
I’ve made the extension available on github: UIImage.rotated and will share it as a cocoapod soon.