In a navigation controller, you automatically get the correct colour and position of a navigation bar as expected.
like this
isTranslucent is set by default to true. Setting it to false will extend the navigation bar below the status bar.
isTranslucent
true
false
navigationBar.isTranslucent = false