こんな感じで実現できました。
UIImageExtension.swift
extension UIImage {
func flipHorizontal() -> UIImage {
UIGraphicsBeginImageContextWithOptions(size, false, 0.0)
let imageRef = self.CGImage
let context = UIGraphicsGetCurrentContext()
CGContextTranslateCTM(context, size.width, size.height)
CGContextScaleCTM(context, -1.0, -1.0)
CGContextDrawImage(context, CGRect(x: 0, y: 0, width: size.width, height: size.height), imageRef)
let flipHorizontalImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return flipHorizontalImage
}
}
これも同様に結構使えました。