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
}
Use the property enabled and tintColor
let barButtonItem:UIBarButtonItem? = nil
if isHidden{
barButtonItem?.enabled = false
barButtonItem?.tintColor = UIColor.clearColor()
}else{
barButtonItem?.enabled = true
barButtonItem?.tintColor = nil
}