Initializer

init(name:)

Creates a CIFilter object for a specific kind of filter.

Declaration

init?(name: String)

Parameters

name

The name of the filter. You must make sure the name is spelled correctly, otherwise your app will run but not produce any output images. For that reason, you should check for the existence of the filter after calling this method.

Return Value

A CIFilter object whose input values are undefined.

Discussion

In macOS, after creating a filter with this method you must call setDefaults() or set parameters individually by calling setValue(_:forKey:). In iOS, the filter’s parameters are automatically set to default values.

See Also

Creating a Filter

init?(name: String, parameters: [String : Any]?)

Creates a CIFilter object for a specific kind of filter and initializes the input values.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software