Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show a NavigationBar on detailViewController of SplitViewController iOS 8

i am using the new iOS 8 SplitViewController i am setting only one detailViewController from storyboard and then i use showDetailViewController() to show a new viewController

self.splitViewController?.showDetailViewController(TableViewController(), sender: nil)

but the NavigationBar is always hidden is there a way to put a NavigationBar on the detailViewController

and yeah btw i tried to unhide the NavigationBar but not working

self.navigationController?.setNavigationBarHidden(false, animated: true)
like image 441
Amr Mohamed Avatar asked Feb 11 '23 18:02

Amr Mohamed


1 Answers

simply we can put a UINavigationController before TableViewController like this and show the navigationController

var nav = UINavigationController(rootViewController:TableViewController())
self.splitViewController?.showDetailViewController(nav, sender: nil)
like image 163
Amr Mohamed Avatar answered Feb 14 '23 10:02

Amr Mohamed