title: Custom back indicator image and iOS 11
body: <p>I'm using a custom back button in my app. This custom back button is set globally like this:</p>
  
  <pre><code>    UINavigationBar.appearance().backIndicatorImage = UIImage(named: "Back").withRenderingMode(.alwaysOriginal)
      UINavigationBar.appearance().backIndicatorTransitionMaskImage = UIImage(asset: .back).withRenderingMode(.alwaysOriginal)
  </code></pre>
  
  <p>Before iOS 11 this code did the trick, but now in iOS 11 the button is not centered vertically anymore as you can see here:</p>
  
  <p><a href="https://i.stack.imgur.com/NndMW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NndMW.png" alt="enter image description here"></a></p>
  
  <p>I could change the height of the back button image to 44, but that would break it in iOS &lt; 11. I could also use two different images, but I was looking for something cleaner, like a way to vertically center the image in the back button container view.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Turns out that, as said by banxii1988, the problem is caused by <code>setBackButtonTitlePositionAdjustment</code> when the values deliberately move the title outside the visible screen. That was an hack to avoid removing the back button title in every view controller. I decided to remove this hack and I did the right thing which is:</p>
  
  <ol>
  <li>set the back button item in the storyboard to <code>" "</code>.</li>
  <li>in each view controller without an associated storyboard, I set
  the <code>backBarButtonItem</code> programmatically
  <code>navigationItem.backBarButtonItem = UIBarButtonItem(title: "",
  style: .plain, target: nil, action: nil)</code></li>
  </ol>
  
  <p>Note that the back button title that you see in a view controller is set in the previous one in the navigation stack.</p>