First create the UIWebView, then define the forward, rewind, refresh buttons, and you need to implement the Uiwebviewdelegate method
1. Back button Events
-(Ibaction) Webviewback: (ID) sender
{
if ([Self.webview CanGoBack]) {
[Self.webview GoBack];
}
}
2. Forward button Event
-(Ibaction) Webviewforward: (ID) sender
{
if ([Self.webview CanGoForward])
[Self.webview GoForward];
}
3. Refresh Events
-(Ibaction) Webviewrefresh: (ID) sender
{
[Self.webview Reload];
}
4.UIWebViewDelegate Proxy Method Webviewdidfinishload
-(void) Webviewdidfinishload: (UIWebView *) webView1
{
NSString *title = [WebView1 stringbyevaluatingjavascriptfromstring:@ "Document.title"];
_webviewtitlelabel.text=title;
if (![ WebView1 CanGoBack])
{
_btnwebviewgoback.enabled=no;
}
Else
{
_btnwebviewgoback.enabled=yes;
}
if (![ WebView1 CanGoForward])
{
_btnwebviewgoforward.enabled=no;
}
Else
{
_btnwebviewgoforward.enabled=yes;
}//determines whether the back and forward keys are available if the WebView is currently ready to go forward or backward after the load is completed
[_indicator stoprotateanimation];//Stop rotating the refreshed picture
[_loadingview stopanimating_loadingview];//Stop Loadingview rotation
}
5.UIWebViewDelegate Proxy Method Webviewdidstartload
-(void) Webviewdidstartload: (UIWebView *) WebView
{
[_indicator startanimating];//starts to rotate the refreshed picture
[_loadingview startanimating_loadingview];//starts Loadingview rotation
}
iOS implements its own web browser (cangoback)