Sak6lab
Sak6lab

Reputation: 118

IOS: Navigation bar disappears after push segue

stroyboard

Every time I perform my show(push) segue the articles VC does not have its navigation bar present to display the title or the back button. I have also checked if the navigation controller has a title as that seemed to be the solution to some cases. The class that performs the segue just sends information. Categories is an enumeration.

enter image description here

Upvotes: 2

Views: 6213

Answers (2)

J Manuel
J Manuel

Reputation: 3070

You have to wrap your articleVC with another NavigationController. Or instead of using segue, you can push it with navigation controller to reuse the NavigationBar.

let yourArticleViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "articleViewControllerIdentifier") as! ArticleViewController
self.navigationController?.pushViewController(yourArticleViewController, animated: true)

Upvotes: 6

Jeacovy Gayle
Jeacovy Gayle

Reputation: 457

ArticlesVC should be embedded in its own navigation controller. That should resolve your issue.

iOS Swift - View Controller - Embedded Navigation Controller

Upvotes: 0

Related Questions