Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send UIWebView title to UINavigationBar

I am trying to send the UIWebView page Title to UINavigationBar.

I would also like it if a user clicks on a link the UINavigationBar shows a back button but if on the home page hide the back button.

like image 815
RussellHarrower Avatar asked Feb 20 '10 07:02

RussellHarrower


1 Answers

to retrieve the title page into an UIWebView you can use it:

myNavigationBar.title = [myWebView stringByEvaluatingJavaScriptFromString:@"document.title"];

If you want to go back you can do that:

if ([myWebView canGoBack]){
    [myWebView goBack];
}

To know if the user has loaded a new page you must set the UIWebViewDelegate. For more information see the UIWebView Class Reference and the UIWebViewDelegate Protocol Reference

like image 93
Yannick Loriot Avatar answered Nov 15 '22 16:11

Yannick Loriot