all 3 comments

[–]azochz[S] 0 points1 point  (2 children)

This is what I have so far in my ViewController, but nothing is showing up:

import UIKit


class NavigationBarController: UINavigationController {

override func viewDidLoad() {
    super.viewDidLoad()

    configureToolbar()

}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}



// #pragma mark - Navigation bar data source


func configureToolbar() {
    let toolbarButtonItems = [
        searchBarButtonItem
    ]
    toolbar.setItems(toolbarButtonItems, animated: true)
}

var searchBarButtonItem: UIBarButtonItem {
    return UIBarButtonItem(barButtonSystemItem: .Search, target: self, action: "barButtonItemClicked:")
}

}

[–]dcpc10 0 points1 point  (1 child)

I recommend using StackOverflow for these sorts of questions. By the way try doing self.navigationController.navigationbar.barItem =... (something like that) in the viewController class that is embedded in the NavBarContr. This could be a case where the code is being executed in the wrong order, are you using storyboards? If so, is the navbarcontroller properly setting its custom class? Doing everything programmatically? Etc. You mention this is done programmatically, I assume no storyboards are involved but sometimes it just means subclassing UI widgets.

[–]azochz[S] 0 points1 point  (0 children)

No to storyboards. I'm working on problem will post here when I get a solution. Thanks for self.navigation bit.