I\'m having a hard time adding a button to the toolbar in swift, below you can see an image of the toolbar that I\'m after, unfortunately even though I have it designed in my St
self.navigationController?.toolbarItems = items
self.navigationController?.setToolbarItems(items, animated: false)
self.navigationController?.toolbar.setItems(items, animated: false)
Try it.
self.navigationController?.toolbarHidden = false
var items = [UIBarButtonItem]()
items.append(
UIBarButtonItem(barButtonSystemItem: .FlexibleSpace, target: self, action: nil)
)
items.append(
UIBarButtonItem(barButtonSystemItem: .Add, target: self, action: "onClickedToolbeltButton:")
)
self.navigationController?.toolbar.setItems(items, animated: false)