When using the front camera of the iPhone 4 to take a picture, the taken picture is mirrored compared with what you see on the iPhone screen. How may I restore the \"on scre
A slightly simpler answer updated for Swift 3:
func flipImage(image: UIImage) -> UIImage {
guard let cgImage = image.cgImage else {
// Could not form CGImage from UIImage for some reason.
// Return unflipped image
return image
}
let flippedImage = UIImage(cgImage: cgImage,
scale: image.scale,
orientation: .leftMirrored)
return flippedImage
}