title: How to apply the navigation bar color to the status bar in an extension?
body: <p>If within an action extension I change the color of the navigation bar as follows:</p>
  
  <pre><code>class ActionViewController: UIViewController {
      override func viewDidLoad() {
          super.viewDidLoad()
          UINavigationBar.appearance().barTintColor = UIColor.green
  </code></pre>
  
  <p>Then the result looks like this, with the status bar in white:</p>
  
  <p><a href="https://i.stack.imgur.com/4f83y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4f83y.png" alt="enter image description here"></a></p>
  
  <p>But if the same line (<code>UINavigationBar.appearance().barTintColor</code>) 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:</p>
  
  <pre><code>class MasterViewController: UITableViewController {
      override func viewDidLoad() {
          UINavigationBar.appearance().barTintColor = UIColor.green
  </code></pre>
  
  <p>Then this is the result with the status bar also green:</p>
  
  <p><a href="https://i.stack.imgur.com/pq6N6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pq6N6.png" alt="enter image description here"></a></p>
  
  <p>How can I get the status bar to appear green in the action extension?</p>