<!--
{
  "availability" : [
    "macOS: 10.3.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebUIDelegate/webView(_:print:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WebUIDelegate(im)webView:printFrameView:"
  },
  "title" : "webView(_:print:)"
}
-->

# webView(_:print:)

Prints the contents of a web frame view.

```
optional func webView(_ sender: WebView!, print frameView: WebFrameView!)
```

## Parameters

`sender`

The web view that sent the message.

`frameView`

The web frame view whose contents to print.

## Discussion

This method is invoked when a script or a user wants to print a webpage. Typically, the delegate implements this method to prepare the web frame view content for printing. The web frame view can handle some content without intervention by the delegate. Send the [`documentViewShouldHandlePrint`](/documentation/WebKit/WebFrameView/documentViewShouldHandlePrint) message to the web frame view to determine if it can handle printing. If this method returns <doc://com.apple.documentation/documentation/Swift/true>, then the delegate can print the content by sending the [`printDocumentView()`](/documentation/WebKit/WebFrameView/printDocumentView()) message to the web frame view. Otherwise, the delegate can use [`printOperation(with:)`](/documentation/WebKit/WebFrameView/printOperation(with:)) to get an <doc://com.apple.documentation/documentation/AppKit/NSPrintOperation> object to print the web frame view.

---

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)