<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIResponderStandardEditActions/printContent(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIResponderStandardEditActions(im)print:"
  },
  "title" : "printContent(_:)"
}
-->

# printContent(_:)

Tells your app to print available content.

```
optional func printContent(_ sender: Any?)
```

## Parameters

`sender`

The object calling this method.

## Discussion

Implement this method on the responder responsible for printing the contents of the window scene; for instance, the root view controller of a [`UIWindow`](/documentation/UIKit/UIWindow). In your implementation, prepare the print job and present an instance of [`UIPrintInteractionController`](/documentation/UIKit/UIPrintInteractionController) to show a Print dialog.

```swift
override func printContent(_ sender: Any?) {
    let info = UIPrintInfo.printInfo()
    info.outputType = .photo
    info.orientation = .portrait
    info.jobName = modelItem.title
    
    let printInteractionController = UIPrintInteractionController()
    printInteractionController.printInfo = info
    printInteractionController.printingItem = modelItem.image
    
    let completionHandler: UIPrintInteractionController.CompletionHandler = {
        (controller: UIPrintInteractionController, completed: Bool, error: Error?) in
        if let error = error {
            Logger().error("Print failed due to an error: \(error.localizedDescription)")
        }
    }
    
    if traitCollection.userInterfaceIdiom == .pad {
        if let printButton = navigationItem.rightBarButtonItem {
            printInteractionController.present(from: printButton, animated: true, completionHandler: completionHandler)
        }
    } else {
        printInteractionController.present(animated: true, completionHandler: completionHandler)
    }
}
```

If your app includes the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/UIApplicationSupportsPrintCommand> key in its `Info.plist` file, people can print from your app using the keyboard shortcut Command-P, which calls [`printContent(_:)`](/documentation/UIKit/UIResponderStandardEditActions/printContent(_:)). You can also set [`printContent(_:)`](/documentation/UIKit/UIResponderStandardEditActions/printContent(_:)) as the action on other print-related controls such as a print button on a toolbar.

For more information about printing from your app, see [Printing](/documentation/UIKit/printing).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)