I am calling AVFoundation
\'s delegate method to handle a photo capture, but I am having difficulty converting the AVCapturePhoto
it generates into
Updated extension provided by Andre which works with Swift 4.2:
import Foundation
import UIKit
extension UIDeviceOrientation {
var imageOrientation: UIImage.Orientation {
switch self {
case .portrait, .faceUp: return .right
case .portraitUpsideDown, .faceDown: return .left
case .landscapeLeft: return .up
case .landscapeRight: return .down
case .unknown: return .up
}
}
}