self?.performSegue is not showing navigation bar

Viewed 2047
self?.performSegue(withIdentifier: "myview", sender: nil)

Above code do not show the navigation bar even though I use push in storyboard. Below code is shows me an error, even though the segue with correct name exist

self?.navigationController?.performSegue(withIdentifier: "myview", sender: nil)

Error

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver () has no segue with identifier 'myview''

6 Answers

I had an issue where presenting a new VC via a segue was showing only a white screen with no navigation bar visible. It seemed like the Navigation Controller was somehow being ignored.

Turns out the app had a strange color pallet set via code like:

UINavigationBar.appearance().tintColor = .white

Giving the new VC a background color showed that the navigation bar and controller were actually there, just all blended together in white.

tint color

Related