I have an app with a SplitView that lets you add companies to a database. In the masterView the companies are shown with their respective company names. Tapping on one of these companies shows me the address in a "viewCell" (not actually a cell just a view within a viewController, just easier to explain). Below that "viewCell" is a tableView (still in the same viewController) with one row: "Employees". Tapping on that leads me to a new tableViewController that lists all the employees that I can add or that I added.
I would like to use a navBarItem to go back and forth between the CompanyDetailViewController and the EmployeesTableViewController.
On iPhone this works nicely with a transition with the automatically created "< Back" navBarItem.
On iPad this does not work. It does not show any navBarItem. I know the reason (the EmployeeTableViewController "thinks" it's the detailView of the masterView, hence it does not need one), but I'd like to be able to transition back and worth with an animation.
My prepareForSegue from the CompanyDetailView to EmployeesTableViewController looks like this:
if (segue.identifier == "ShowEmployeesSegue")
{
let controller = (segue.destinationViewController as! UINavigationController).topViewController as! EmployeesTableViewController
controller.navigationItem.leftBarButtonItem = self.splitViewController?.displayModeButtonItem()
controller.navigationItem.leftItemsSupplementBackButton = true
controller.coreDataStack = coreDataStack
controller.companyToView = companyToView as? Company
}
Update: Some Screenshots
iPhone: http://i.stack.imgur.com/ivl86.png
MasterView with 3 Test Companies
DetailView of Test Company 1
List of employees of Test Company 1 after tapping on Employees, "< Back"-Button visible
iPad: http://i.stack.imgur.com/ObBto.png
MasterView with DetailView of Test Company 1
List of Employees of Test Company 1, No "< Back"-Button visible to go back to DetailView of Test Company 1

