I spent a very long time thinking that I could somehow not put a UINavigationController in a container view (despite having done so before) because I was autocompleting to setToolbarHidden instead of setNavigationBarHidden. A very, very long time.
guard let myNavController = self.navigationController else
{
return
}
myNavController.setToolbarHidden(true, animated: true)
// is different than
myNavController.setNavigationBarHidden(true, animated: true)