I created a function for splitting an image into multiple images, but when I take take the CGImage of the UIImage, the CGImage returns NULL
NSArray* splitIma
Convert CGImage to UIImage with this and cgImage will not be null:
func convert(cmage:CIImage) -> UIImage { let context:CIContext = CIContext.init(options: nil) let cgImage:CGImage = context.createCGImage(cmage, from: cmage.extent)! let image:UIImage = UIImage.init(cgImage: cgImage) return image }