Incase you are wondering why the buttons are not showing up on a navigation bar

// create a controller
UIViewController* controller = [[UIViewController alloc] init];
// create a view
UIWebView* webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
// add the view to the controller
[controller.view addSubview:webView];
// create a navigation controller
UINavigationController *navBar=[[UINavigationController alloc]initWithRootViewController:webviewController];
// create a button
UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithCustomView:...];
// set the bar button
[navBar.navigationItem setLeftBarButtonItem:button];
// *** most important one
// add the button to the navigation item of the controller and
// not to the navigation controller
[webviewController.navigationItem setLeftBarButtonItem:button];
// present view controller
[self.navigationController presentViewController:navBar animated:YES completion:^{
}];

Leave a Reply

Your email address will not be published. Required fields are marked *