UIWebView canGoForward
@property(nonatomic, readonly, getter=canGoForward) BOOL canGoForward
Discussion of [UIWebView canGoForward]
If YES, able to move forward; otherwise, NO .
UIWebView canGoForward example.
- (void) webViewDidFinishLoad:(UIWebView *)webView {
if ([resultsWebView canGoBack]) {
[goBackButton setEnabled:YES];
}
else {
[goBackButton setEnabled:NO];
}
if ([resultsWebView canGoForward]) {
[goForwardButton setEnabled:YES];
}
else {
[goForwardButton setEnabled:NO];
}
}
if ([resultsWebView canGoBack]) {
[goBackButton setEnabled:YES];
}
else {
[goBackButton setEnabled:NO];
}
if ([resultsWebView canGoForward]) {
[goForwardButton setEnabled:YES];
}
else {
[goForwardButton setEnabled:NO];
}
}
Example of [UIWebView canGoForward].
- (void)webViewDidFinishLoad:(UIWebView *)webView {
BOOL ableToGoBack = [webViewOutlet canGoBack];
BOOL ableToGoForword = [webViewOutlet canGoForward];
if (ableToGoBack == YES) {
UIImage *goBackImageChange = [UIImage imageNamed:@"browserBack@2x.png"];
[goback setBackgroundImage:goBackImageChange forState:UIControlStateNormal];
} else {
UIImage *goBackImageChange = [UIImage imageNamed:@"browserBackInactive@2x.png"];
[goback setBackgroundImage:goBackImageChange forState:UIControlStateNormal];
}
if (ableToGoForword == YES) {
UIImage *goForwordImageChange = [UIImage imageNamed:@"browserForward@2x.png"];
[goforowrd setBackgroundImage:goForwordImageChange forState:UIControlStateNormal];
} else {
UIImage *goForwordImageChange = [UIImage imageNamed:@"browserForwardInactive@2x.png"];
[goforowrd setBackgroundImage:goForwordImageChange forState:UIControlStateNormal];
}
[activityIndicator stopAnimating];
activityIndicator.hidden = YES;
}
BOOL ableToGoBack = [webViewOutlet canGoBack];
BOOL ableToGoForword = [webViewOutlet canGoForward];
if (ableToGoBack == YES) {
UIImage *goBackImageChange = [UIImage imageNamed:@"browserBack@2x.png"];
[goback setBackgroundImage:goBackImageChange forState:UIControlStateNormal];
} else {
UIImage *goBackImageChange = [UIImage imageNamed:@"browserBackInactive@2x.png"];
[goback setBackgroundImage:goBackImageChange forState:UIControlStateNormal];
}
if (ableToGoForword == YES) {
UIImage *goForwordImageChange = [UIImage imageNamed:@"browserForward@2x.png"];
[goforowrd setBackgroundImage:goForwordImageChange forState:UIControlStateNormal];
} else {
UIImage *goForwordImageChange = [UIImage imageNamed:@"browserForwardInactive@2x.png"];
[goforowrd setBackgroundImage:goForwordImageChange forState:UIControlStateNormal];
}
[activityIndicator stopAnimating];
activityIndicator.hidden = YES;
}
UIWebView canGoForward example.
-(void)webViewDidFinishLoad:(UIWebView *)webView
{
// Enable or disable back
[myBackButton setEnabled:[myWebView canGoBack]];
// Enable or disable forward
[myForwardButton setEnabled:[myWebView canGoForward]];
}
{
// Enable or disable back
[myBackButton setEnabled:[myWebView canGoBack]];
// Enable or disable forward
[myForwardButton setEnabled:[myWebView canGoForward]];
}