[swift] UIBarButtonItemを表示にする
UIBarButtonItemを表示にする
UIBarButtonItemにはUIButtonのようにhiddenオプションがないために以下の通りで非表示にする
@IBOutlet var button: UIBarButtonItem! if(condition == true) { button.enabled = false button.tintColor = UIColor(white: 0, alpha: 0) } else { button.enabled = true button.tintColor = UIColor(white: 1, alpha: 1) }