Open etrep opened 9 years ago
I'm running Xcode 6.2 beta-4 with:
let filter = CIFilter(name: "CIConstantColorGenerator", withInputParameters: [kCIInputColorKey: CIColor(color: color)!])
And it runs with nothing displayed, except the following output:
This NSLayoutConstraint is being configured with a constant that exceeds internal limits. A smaller value will be substituted, but this problem should be fixed. Break on void _NSLayoutConstraintNumberExceedsLimit() to debug. This will be logged only once. This may break in the future.
Which suggests that the size is WAY too big, so I added the crop extents and it works:
func colorGenerator(color: UIColor) -> Filter { return { image in let filter = CIFilter(name: "CIConstantColorGenerator", withInputParameters: [kCIInputColorKey: CIColor(color: color)!]) return filter.outputImage.imageByCroppingToRect(image.extent()) } }
Hello, I'm trying to follow along the code in this article and I am running into some issues.
I'm on Yosemite 10.10.1, running Xcode 6.1 (6A1052d).
When I initially opened the project and tried building it, I was getting the following compile error: /Users/eric/Projets/Learning/Objcio/issue-16-functional-apis-master/FunctionalCoreImage/CoreImage.swift:39:22: Cannot invoke 'init' with an argument list of type '(name: StringLiteralConvertible, parameters: $T5)'
After a bit of digging around (I'm still pretty new with Swift), I figured out that I apparently needed to add an exclamation mark after the CIColor constructor (although I'm not quite sure I understand why):
This allows the build to complete successfully, but then when trying to run the program, I get an exception thrown in the CIFilter's convenience init method:
Is anyone else encountering this issue?