Hi, I added a navigationItem to my navigation bar but unfortunately it doesn't appear in the simulator.
import UIKit
class ViewController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
// there are more view controllers
let vc2 = SecondViewController()
self.setViewControllers([vc2], animated: false)
guard let items = self.tabBar.items else {
return
}
let images = ["house", "bell", "person.circle","person.circle"]
for x in 0..<items.count {
//items[x].badgeValue= "1"
items[x].image = UIImage(systemName: images[x])
}
self.tabBar.tintColor = .black
}
}
the relevant code of the SecondViewController
class SecondViewController: UINavigationController {
override func viewDidLoad() {
title = "Decount timers"
super.viewDidLoad()
view.backgroundColor = .systemBackground
navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(didTapAddButton))
}
}
Thank you for your help