Created
June 15, 2018 16:01
-
-
Save onmyway133/f1605ff557d90524a14042add0cd3175 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 CIImage { | |
func toUIImage() -> UIImage? { | |
let context: CIContext = CIContext.init(options: nil) | |
if let cgImage: CGImage = context.createCGImage(self, from: self.extent) { | |
return UIImage(cgImage: cgImage) | |
} else { | |
return nil | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment