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

# webView(_:shouldChangeTypingStyle:toStyle:)

Returns whether the user should be allowed to change the typing style in a web view.

```
optional func webView(_ webView: WebView!, shouldChangeTypingStyle currentStyle: DOMCSSStyleDeclaration!, toStyle proposedStyle: DOMCSSStyleDeclaration!) -> Bool
```

## Parameters

`webView`

The web view that the user is editing.

`currentStyle`

The old style the user wants to change.

`proposedStyle`

The new style the user wants to set.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the user should be allowed to change the typing style in `webView` to `proposedStyle`; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

You can implement this method to take some other action—for example, set the typing style to a different style—and return <doc://com.apple.documentation/documentation/Swift/false> .

## See Also

[`webViewDidChangeTypingStyle(_:)`](/documentation/WebKit/WebEditingDelegate/webViewDidChangeTypingStyle(_:))

Sent by the default notification center when the user changes the typing style in the web 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)