Type Method

canPrint(_:)

Returns whether UIKit can print the contents of a data object.

Declaration

class func canPrint(_ data: Data) -> Bool

Parameters

data

An instance of the NSData class that contains PDF data or an image in a format supported by the Image I/O framework. See View Programming Guide for iOS in View Programming Guide for iOS for a list of the supported image formats.

Return Value

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

Discussion

You should call this method to test a data object prior to assigning it to printingItem or printingItems.

See Also

Determining Printability

class var isPrintingAvailable: Bool

Returns a Boolean indicating whether the device supports printing.

class func canPrint(URL) -> Bool

Returns whether UIKit can print the file referenced by a URL.

class var printableUTIs: Set<String>

Returns a set of the Uniform Type Identifiers for the types of data that UIKit can print.