0

I am trying to setup a master/detail view with CardTableView as my root and am having trouble implementing

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 
    //code
}

I want to use a self.navigationController?.pushViewController so that the detail view can easily come back to the table view. However when I try to embed this in a Navigation controller I get a strange looking title bar:

enter image description here

This is my view hierarchy:

let tabs = AppPageTabBarController(viewControllers:[InvitedViewController(), CoordinatingViewController(), PastViewController()])
let toolbar = AppToolbarController(rootViewController: tabs)
let navigationController = UINavigationController(rootViewController:toolbar)
let fabController = AppFABController(rootViewController: navigationController)
let snackBarController = AppSnackbarController(rootViewController:fabController)
let navDrawer = MyTeeUpsViewController(rootViewController: snackBarController, leftViewController: NavDrawerContainerController())
self.present(navDrawer, animated: true)

Wondering if there are any alternatives to this approach

rmaddy
  • 314,917
  • 42
  • 532
  • 579
kinghenry14
  • 1,187
  • 1
  • 11
  • 34

1 Answers1

0

By default, UINavigationController shows its own navigation bar above your view controller(s). In your screenshot, it's the large, light-colored bar above your views. If you don't want this, you'll have to set it so when you instantiate the navigation controller:

// You may want to animate it if you hide/show it after it's onscreen
navigationController.setNavigationBarHidden(true, animated: false)
Michael Hulet
  • 3,253
  • 1
  • 16
  • 33