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
None of the above worked for me, but:
Swift 3 / Swift 4
self.navigationController?.isToolbarHidden = false
var items = [UIBarButtonItem]()
items.append( UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: self, action: nil) )
items.append( UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(add)) ) // replace add with your function
self.toolbarItems = items // this made the difference. setting the items to the controller, not the navigationcontroller