Question: How to hide or remove the default BarButtonItem call item in Toolbar

Question

How to hide or remove the default BarButtonItem call item in Toolbar

Answers 0
Added at 2016-12-21 10:12
Tags
Question

As above title. I did the following:

  1. Drag a toolbar into Viewcontroller and aligned it below the status bar.

  2. There is a default barbuttonitem call item in it.

  3. I use below code to add a new bar button

And here the code :

let item1 = UIBarButtonItem(title:"back", style: .Plain, target: self, action: #selector(GoBack))

simpleToolbar.items?.append(item1) // simpleToolbar is UIToolBar

func GoBack(barButtonItem: UIBarButtonItem){

}

Question:

1) How to I use the default item call item to do the same thing as GoBack?

2) If there is no use, how to remove it ?

Thanks

Answers
Source Show
◀ Wstecz