Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

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)
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #image #copy #swift #extension
ADD COMMENT
Topic
Name
5+8 =