UIWebViewDelegate Protocol Reference

Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 2.0 and later.
Declared in
UIWebView.h
Related sample code

Overview

The UIWebViewDelegate protocol defines methods that a delegate of a UIWebView object can optionally implement to intervene when web content is loaded.

Tasks

Loading Content

Instance Methods

webView:didFailLoadWithError:

Sent if a web view failed to load a frame.

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
Parameters
webView

The web view that failed to load a frame.

error

The error that occurred during loading.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIWebView.h

webView:shouldStartLoadWithRequest:navigationType:

Sent before a web view begins loading a frame.

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
Parameters
webView

The web view that is about to load a new frame.

request

The content location.

navigationType

The type of user action that started the load request.

Return Value

YES if the web view should begin loading content; otherwise, NO .

Availability
  • Available in iOS 2.0 and later.
Declared In
UIWebView.h

webViewDidFinishLoad:

Sent after a web view finishes loading a frame.

- (void)webViewDidFinishLoad:(UIWebView *)webView
Parameters
webView

The web view has finished loading.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIWebView.h

webViewDidStartLoad:

Sent after a web view starts loading a frame.

- (void)webViewDidStartLoad:(UIWebView *)webView
Parameters
webView

The web view that has begun loading a new frame.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIWebView.h