Created
December 3, 2018 17:32
-
-
Save JoshuaSullivan/7b01141fe82c308519ee537d9120cc70 to your computer and use it in GitHub Desktop.
An extension on `UIImage.Orientation` to convert it to the corresponding `CGImagePropertyOrientation` case.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIImage.Orientation { | |
/// Get the equivalent `CGImagePropertyOrientation` enum case. | |
var cgOrientation: CGImagePropertyOrientation { | |
switch self { | |
case .up: return .up | |
case .down: return .down | |
case .left: return .left | |
case .right: return .right | |
case .upMirrored: return .upMirrored | |
case .downMirrored: return .downMirrored | |
case .leftMirrored: return .leftMirrored | |
case .rightMirrored: return .rightMirrored | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment