title: How to set bar button item background image globally in iOS 13
body: <p>iOS 13 has a whole new set of classes for configuring navigation bars and bar button items:</p>
  
  <ul>
  <li>UIBarAppearance</li>
  <li>UINavigationBarAppearance</li>
  <li>UIBarButtonItemAppearance</li>
  <li>UIBarButtonItemStateAppearance</li>
  </ul>
  
  <p>How do I use these to give bar button items a global appearance? Let's say I want all bar button items to have a common background image. I used to say:</p>
  
  <pre><code>UIBarButtonItem.appearance().setBackgroundImage(im, for:.normal, barMetrics:.default)
  </code></pre>
  
  <p>This seems to be just what is superseded by these new classes. So what's the right way now?</p>