added view lifecycle methods to navbar view controller