---
title: "canPrint(_:)"
framework: uikit
role: symbol
role_heading: Type Method
path: "uikit/uiprintinteractioncontroller/canprint(_:)-4e0bs"
---

# canPrint(_:)

Returns a Boolean value that indicates whether UIKit can print the contents of a data object.

## Declaration

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

## Parameters

- `data`: An instance of the doc://com.apple.documentation/documentation/Foundation/NSData class that contains PDF data or an image in a format supported by the Image I/O framework. See https://developer.apple.com/library/archive/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009503 in https://developer.apple.com/library/archive/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009503 for a list of the supported image formats.

## Return Value

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

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

## See Also

### Determining printability

- [isPrintingAvailable](uikit/uiprintinteractioncontroller/isprintingavailable.md)
- [canPrint(_:)](uikit/uiprintinteractioncontroller/canprint(_:)-364vj.md)
- [printableUTIs](uikit/uiprintinteractioncontroller/printableutis.md)
