How to setup a Bar Button with a value of firebase?
问题 I want to check if the user is a admin or not. If the user is a admin, I want to show a bar button. If not, the bar button should be hidden. I call the following code in viewDidLoad : @IBOutlet weak var beitraegeMelden: UIBarButtonItem! var admin = false func setupBarButton() { observeAdmin() if admin == true { self.beitraegeMelden.isEnabled = true self.navigationItem.rightBarButtonItem = self.beitraegeMelden } else { self.beitraegeMelden.isEnabled = false self.navigationItem