Customizing UINavigationBar back button image with UIAppereance doesn't work

Originator:marcelofabri.mf
Number:rdar://32999665 Date Originated:27-Jun-2017 10:00 AM
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 11 b2
Classification:Other Bug Reproducible:Always
 
Summary:
In iOS11 and before version, when a customized image is set to navigation bar back button, the default back image will be hidden. However, In iOS11, both back images(the default one and the customized one) will be shown.

Steps to Reproduce:
1. Create a new project
2. Make a navigation controller as root and add a button that pushes another view controller
3. Add UIBarButtonItem.appearance().setBackButtonBackgroundImage(image, for: .normal, barMetrics: .default) to the AppDelegate with some image
4. Run the app and tap the button that pushes another view controller

Expected Results:
Only the image you set should be shown in the back button

Actual Results:
The default back button image is shown as well

Version:
iOS 11 b2

Notes:
I’m attaching a sample project that shows the issue, as well as two images that show it (using a 50x50 red image)

Comments

setBackButtonBackgroundImage sets the background image, not the actual image.

The correct solution should be: UINavigationBar.appearance().backIndicatorImage = … UINavigationBar.appearance().backIndicatorTransitionMaskImage = …

Even I found the same issue. Anyone found the solution for this.

By Shreeshakedilaya at Sept. 26, 2017, 6:01 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!