0

I have added a tint to the UINavigationBar via the following lines of code in the AppDelegate:

let navBar = UINavigationBar.appearance()
navBar.barTintColor = mainColor

first view controller

However when I go to a different view via a segue, I lose the color. View 2 isn't embedded in its own UINavigationController.

View 2

If I embed it in a nav controller it appears however if I go to View 3 from View 2, it too disappears.

I'm using 'Show' as the segue option.

Bilbo Baggins
  • 3,644
  • 8
  • 40
  • 64

1 Answers1

0

I had used an @IBAction action to go from View 2 to View 3. That's why I had to replace

navigationController?.popViewControllerAnimated(true)

with the following:

self.dismissViewControllerAnimated(true, completion: nil)

I learned this via - Go back to previous view controller doesn't work

Community
  • 1
  • 1
Bilbo Baggins
  • 3,644
  • 8
  • 40
  • 64