Contents

finish(with:)

Notifies AVFoundation that you cannot fulfill the image filtering request.

Declaration

func finish(with error: any Error)

Parameters

  • error:

    An error object describing the reason to

Discussion

Call this method if you cannot process the input image and wish to abort playback as a result—for example, if the doc://com.apple.documentation/documentation/coreimage/cifilter-swift.class/outputimage object from your filter chain is nil. (If instead you want to fall back to rendering an unfiltered image, call the finish(with:context:) and pass the sourceImage object to the filteredImage parameter.)

Calling this method causes AVFoundation to post a notification named failedToPlayToEndTimeNotification. Observers of this notification can use the AVPlayerItemFailedToPlayToEndTimeErrorKey key to examine the error you provide.

See Also

Returning the filtered image