我在最后一行有一个错误 - Ambigous use of 'init(CIImage:)'
。任何人都可以帮我解决这个问题吗?
let origImage = CIImage(image: img)
let filter = CIFilter(name: "CIColorInvert")
filter?.setValue(origImage, forKey: kCIInputImageKey)
let invertedImage = UIImage(CIImage: (filter?.outputImage)!)
答案 0 :(得分:2)
在Swift 3中,UIImage(CIImage: ...)
构造函数被重命名为:
let invertedImage = UIImage(ciImage: ...)