I created a toolbar in IB with several buttons. I would like to be able to hide/show one of the buttons depending on the state of the data in the main window.
@IBDesignable class AttributedBarButtonItem: UIBarButtonItem { var isHidden: Bool = false { didSet { isEnabled = !isHidden tintColor = isHidden ? UIColor.clear : UIColor.black } } }
And now simply change isHidden property.
isHidden