Answers for "image copy swift extension"

0

image copy swift extension

extension UIImage {
    func clone() -> UIImage? {
        guard let originalCgImage = self.cgImage, let newCgImage = originalCgImage.copy() else {
            return nil
        }

        return UIImage(cgImage: newCgImage, scale: self.scale, orientation: self.imageOrientation)
    }
}
Posted by: Guest on December-21-2021

Code answers related to "Swift"

Browse Popular Code Answers by Language