If within an action extension I change the color of the navigation bar as follows:
class ActionViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
UINavigationBar.appearance().barTintColor = UIColor.green
Then the result looks like this, with the status bar in white:
But if the same line (UINavigationBar.appearance().barTintColor
) is applied to an application (as opposed to an extension) then the result is different, for example if the following line is added to the XCode master-detail template project:
class MasterViewController: UITableViewController {
override func viewDidLoad() {
UINavigationBar.appearance().barTintColor = UIColor.green
Then this is the result with the status bar also green:
How can I get the status bar to appear green in the action extension?