Xitcod13
Xitcod13

Reputation: 6079

Navigation bar not displaying popViewControllerAnimated() not working

I'm pretty new to swift development but I am trying to implement a back button in my application.

I have the following layout in my Main.storyboard

Main.Storyboard

As seen in the picture the navigation bars display however when i lunch my app they are not visible.

I also have tried using a button that will take me back to the previous view with

self.navigationController?.popViewControllerAnimated(true)

but it has not worked


Update: The image above doesnt show the initial controller which is my ViewController

the problem is that All Routes is actually a PageContentViewController which is called from ViewController which checks for fb login than calls:

dispatch_async(dispatch_get_main_queue()){
self.setViewControllers([self.getViewControllerAtIndex(0)] as [UIViewController], direction: UIPageViewControllerNavigationDirection.Forward, animated: false, completion: nil)
}

So i cannot change my initial view controller. I dont know how I can get around this problem. Is there a way to do it from Main.storyboard or a programistic solution ?

Upvotes: 1

Views: 411

Answers (1)

Xitcod13
Xitcod13

Reputation: 6079

Embedding my initial view in a navigational controller and setting it to the initial view has worked.

Even though it doesnt look right on the preview because my initial view calls the other views programmatically it works correctly on the device

Upvotes: 1

Related Questions