I have an IBOutlet that I have linked to from the storyboard
@IBOutlet var creeLigueBouton: UIBarButtonItem!
and I want to make it disappear if a condition is true
if(condition == true)
{
// Make it disappear
}
I have an IBOutlet that I have linked to from the storyboard
@IBOutlet var creeLigueBouton: UIBarButtonItem!
and I want to make it disappear if a condition is true
if(condition == true)
{
// Make it disappear
}
For Swift 3
heres my solution:
hide:
show:
The following solution works for me.
You can use text attributes to hide a bar button:
Also I've made extension for UIBarButtonItem with a hidden property:
First way:
Just set
.title
to""
Second way:
Just call
updateToolBar()
whenever you want to show/hide thecreeLigueBouton
.