1

I have two view controllers and a Navigation contoller in a storyboard. In the first view controller I have two buttons.

Both buttons segue to the second view which contains a map and opens the map with different info. They are both of the kind show.

The first button when clicked opens the map with the navigation bar at the top (it loads from the side).

The second button loads the map without the navigation bar (it loads from the bottom).

I want both buttons to load the map with the navigation bar.

I am using xcode 7.3 swift and storyboards

Also using prepare for segue

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
  if(segue.identifier == "lav"){
    let DestViewController = segue.destinationViewController as! MapView
    DestViewController.type = typeLav
  }
  if(segue.identifier == "cam"){
    let DestViewController = segue.destinationViewController as! MapView
    DestViewController.type = typeCam
  }
}
Mihriban Minaz
  • 3,043
  • 2
  • 32
  • 52
JoeyA
  • 21
  • 1
  • 3

1 Answers1

3

Set the segue action

  • Present Modally

    Show Up from bottom, and without navigation controller, so there is no navbar too.

  • Push

    Push the view controller to current navigation stack, so the navigation bar is shown

btw, method prepareForSegue was used to setup data transfered between view controllers;

horsley
  • 480
  • 4
  • 10
  • Thanks, I reset the segue to present modally, built the project then reset both segues to show and now it works as wanted – JoeyA Apr 13 '16 at 10:18