Contents

canInit(with:)

Returns a Boolean value that indicates whether the image representation can initialize itself from the specified data.

Declaration

class func canInit(with data: Data) -> Bool

Parameters

  • data:

    The image data.

Return Value

true if the receiver understands the format of the specified data and can use it to initialize itself; otherwise, false.

Discussion

This method should be overridden by subclasses. Note that this method does not need to do a comprehensive check of the image data; it should return false only if it knows it cannot initialize itself from the data.

See Also

Determining Types for Images