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
The usual way to do that is to create the array of toolbar items and then assign the array to the items
property of the toolbar.
self.navigationController?.isToolbarHidden = false
var items = [UIBarButtonItem]()
items.append(
UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
)
items.append(
UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(onClickedToolbeltButton(_:)))
)
toolbarItems = items