Contents

canPrint(_:)

Returns a Boolean value that indicates whether UIKit can print the file that the specified URL references.

Declaration

class func canPrint(_ url: URL) -> Bool

Parameters

  • url:

    An object representing a URL. Valid NSURL objects must use the file: or any scheme that can return an Nsdata object with a registered protocol. The file referenced by the URL must contain PDF data or an image in a format supported by the Image I/O framework. See TP40009503 in TP40009503 for a list of the supported image formats.

Return Value

true if UIKit can print the contents of the referenced file, otherwise false. The method returns false if url references PDF data that specifies that printing is not allowed.

Discussion

You should call this method to test the data referenced by a URL prior to assigning that URL to printingItem or printingItems.

See Also

Determining printability