UIBarButtonItem setBackButtonBackgroundImage leading to strangely rendered image

Originator:crayment16
Number:rdar://33223395 Date Originated:10-Jul-2017 04:13 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:11 beta 3
Classification:UI/Usability Reproducible:Always
 
Summary:
Using this code:

// Set the Back Button Image
        var backButtonImage = UIImage(named: "iconArrowBack")
        backButtonImage = backButtonImage?.withRenderingMode(UIImageRenderingMode.alwaysOriginal)
        backButtonImage = backButtonImage?.withAlignmentRectInsets(Style.Constants.backButtonInsets)
        UIBarButtonItem.appearance().setBackButtonBackgroundImage(backButtonImage, for: .normal, barMetrics: .default)

To style the back button leads to an image that looks like this: https://cl.ly/220A3g0H3I2k/Image%202017-07-10%20at%204.12.29%20PM.png

This is a regression and renders correctly on iOS 9/10

Steps to Reproduce:
- Set back image using UIBarButtonItem.appearance().setBackButtonBackgroundImage with alwaysOriginal rendering mode
- Get strange rendering artifacts

Expected Results:
original image to be rendered

Actual Results:
Strange artifacts

Version:
11 beta 3

Notes:

Comments


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!