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

# webView(_:validate:defaultValidation:)

Returns a Boolean value that indicates whether the specified user interface item is valid.

```
optional func webView(_ webView: WebView!, validate item: (any NSValidatedUserInterfaceItem)!, defaultValidation: Bool) -> Bool
```

## Parameters

`webView`

The web view that sent the message.

`item`

The user interface item being validated.

`defaultValidation`

<doc://com.apple.documentation/documentation/Swift/true> if the web view believes the user interface item is valid; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the specified user interface item is valid; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

See <doc://com.apple.documentation/documentation/AppKit/NSUserInterfaceValidations> and <doc://com.apple.documentation/documentation/AppKit/NSValidatedUserInterfaceItem> for more information about user interface validation. If you do not implement this method, the value of `defaultValidation` is used.

---

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)