I'm trying to add my image on UINavigationItem using this code:
override func viewDidLoad() {
super.viewDidLoad()
self.navItemTop.titleView?.contentMode = UIViewContentMode.scaleToFill
self.navItemTop.titleView? = ViewController4.navigationImage! //my image, its correct for sure
self.navigationController?.navigationBar.barTintColor = UIColor.white
}
When i go to another UIViewController and then go back, image appears and disappears a second later. I've tried to put this piece of code in viewWillAppear() method, but result is the same. How can i fix this?