Open jonnolen opened 10 years ago
Maybe it's a bug of playground , because it works as below code:
import UIKit
let image = UIImage(named: "cover")
let gaussianBlurFilter = CIFilter(name: "CIGaussianBlur")
gaussianBlurFilter.setValue(CIImage(image: image), forKey: kCIInputImageKey)
gaussianBlurFilter.setValue(10, forKey: kCIInputRadiusKey)
let ctx = CIContext(options:nil)
let cgImage = ctx.createCGImage(gaussianBlurFilter.outputImage, fromRect:gaussianBlurFilter.outputImage.extent())
UIImage(CGImage: cgImage)
I'm following along at home, but I can't get CIImage objects to work in a swift playground? Anyone have any luck with this?