<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIWebViewDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIWebViewDelegate"
  },
  "title" : "UIWebViewDelegate"
}
-->

# UIWebViewDelegate

The `UIWebViewDelegate` protocol defines methods that a delegate of a [`UIWebView`](/documentation/UIKit/UIWebView) object can optionally implement to intervene when web content is loaded.

```
@MainActor protocol UIWebViewDelegate : NSObjectProtocol
```

## Overview> Important:
> Before releasing an instance of `UIWebView` for which you have set a delegate, you must first set the `UIWebView` delegate property to `nil` before disposing of the `UIWebView` instance. This can be done, for example, in the dealloc method where you dispose of the `UIWebView`.

## Topics

### Loading Content

[`webView(_:shouldStartLoadWith:navigationType:)`](/documentation/UIKit/UIWebViewDelegate/webView(_:shouldStartLoadWith:navigationType:))

Sent before a web view begins loading a frame.

[`webViewDidStartLoad(_:)`](/documentation/UIKit/UIWebViewDelegate/webViewDidStartLoad(_:))

Sent after a web view starts loading a frame.

[`webViewDidFinishLoad(_:)`](/documentation/UIKit/UIWebViewDelegate/webViewDidFinishLoad(_:))

Sent after a web view finishes loading a frame.

[`webView(_:didFailLoadWithError:)`](/documentation/UIKit/UIWebViewDelegate/webView(_:didFailLoadWithError:))

Sent if a web view failed to load a frame.



---

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)
