0
votes

I'm developing a swift app that has a Tab Bar Controller and one of the tabs has a Navigation Controller. The tab with a Navigation Controller has a Table View, and the cells in the Table View segue to a regular View Controller. The information appears in the destination view controller as desired, put when the destination view controller is presented, both the tab bar and the navigation bar disappear.

Here is my prepareForSegue:

    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        if segue.identifier == "entryCellToEntryView" {
            if let destination = segue.destinationViewController as? EntryDetailViewController {
                if let index = customTableView.indexPathForSelectedRow {
                    if let cell = customTableView.cellForRowAtIndexPath(index) as? EntryTableViewCell {
                        destination.entryToDisplay = cell.entry
                    } else {
                        print("prepareForSeque: Unable to cast cell as EntryTableViewCell")
                    }
                } else {
                    print("prepareForSeque: Index cannot be established")
                }
            } else {
                print("prepareForSeque: Destination cannot be downcast to EntryDetailViewController")
            }
        }
    }

Here is a link to a photo of my storyboard: http://grantbroadwater.com/storyboard.png

1

1 Answers

1
votes

The navigation bar and tab bar disappears, because you are using model segue.

Change segue to push are show.

In model segue destination ViewController appears on the top of current viewController. So destination view controller does not have any idea about your navigation stack or tab bar.

If you use push segue, or show segue now a days, then only it will be pushed into navigation stack.