There are several windows, you need to add a label to the navigation bar in the header, which will be the same for all windows, but can be changed. Did so

 let longTitleLabel = UILabel() longTitleLabel.text = String(score) longTitleLabel.sizeToFit() let Item = UIBarButtonItem(customView: longTitleLabel) self.navigationItem.rightBarButtonItem = Item 

The score variable is stored locally in the database, the problem is that when I change it in one window in another it is not updated (in principle, it is logical), how can I update the label in all windows? I now have a label added to the viewDidLoad , but because I’m using a navigation control , this method works once, how can I solve this problem?

  • 2
    Move addon to viewWillAppear - Ivan Kramarchuk
  • @IvanKramarchuk thanks - Lolidze

0