Silver challenge using Navigation controller's Tool bar

BNRWebViewController

//
//  BNRWebViewController.m
//  NerdFeed
//
//  Created by Vaasu on 11/4/15.
//

#import "BNRWebViewController.h"

@interface BNRWebViewController () <UIWebViewDelegate>
@property (nonatomic) UIWebView *webView ;
@end

@implementation BNRWebViewController


-(instancetype)init
{
    self = [super init];
    
    if (self) {
        UIBarButtonItem *goBackButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRewind target:self.view action:@selector(goBack)];
        UIBarButtonItem *goForwardButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFastForward target:self.view action:@selector(goForward)];
        [goBackButton setEnabled:NO];
        [goForwardButton setEnabled:NO];
        self.toolbarItems = [[NSArray alloc]initWithObjects:goBackButton,goForwardButton, nil] ;
        
    }
    return self;
}

-(void)loadView
{
    _webView= [[UIWebView alloc] init];
    _webView.scalesPageToFit = YES;
    _webView.delegate = self;
    self.view = _webView;
    
}

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear];
    self.navigationController.toolbarHidden = NO;
}

-(void)setURL:(NSURL *)URL
{
    _URL = URL;
    if (_URL) {
        NSURLRequest *req = [NSURLRequest requestWithURL:_URL];
        [self.webView loadRequest:req];
    }
}

-(void)webViewDidStartLoad:(UIWebView *)webView
{
    [(UIBarButtonItem *)self.toolbarItems.firstObject setEnabled:(webView.canGoBack)];
    
    [(UIBarButtonItem *)self.toolbarItems.lastObject setEnabled:(webView.canGoForward)];
}

@end

Your code works great!

I just wanted to point out that setEnabled: needs to be called in -(void)webViewDidFinishLoad:(UIWebView *)webview
for the back & forward button to function properly.

-(void)webViewDidFinishLoad:(UIWebView *)webView {
[(UIBarButtonItem *)self.toolbarItems.firstObject setEnabled:(webView.canGoBack)];
[(UIBarButtonItem *)self.toolbarItems.lastObject setEnabled:(webView.canGoForward)];
}

Thank!