In iOS 14 and 15 I could use the .alwaysTemplate rendering mode of a UIImage and set that as the image of a UIButton. Then set the tintColor of the UIButton to change the color of the button image. However, in iOS 16 (tested with beta 3 and beta 4) it's not working.
Is this is bug with the beta? Or did something change in iOS 16? Thanks!
let templateImage = uiImage.withRenderingMode(.alwaysTemplate)
uiButton.setImage(templateImage, for: .normal)
uiButton.tintColor = .systemYellow