UIStepper do not respect tint color in iOS 13

Hi!


Prior to iOS 13 it was possible to change the color of the text (+ and -) of a UIStepper by setting the desired color in the tintColor attribute.

Unfortunately in iOS 13 (beta 7) this no longer works and the text color is always black.


Has anyone found a way to change the stepper text color?


Thank you


Alan

Answered by DaleOne in 378840022

I just received an official response from Apple. They say that this is the intended behaviour. That's weird.


However, I still think it's a iOS 13 bug because if you assign an image (setIncrementImage or setDecrementImage) the component start to correctly respond to tintColor. You can even set it's default image!


So, in conclusion, if you want to change the tint color of a UIStepper in iOS13 you need to add these two lines of code:


stepper.setDecrementImage(stepper.decrementImage(for: .normal), for: .normal)
stepper.setIncrementImage(stepper.incrementImage(for: .normal), for: .normal)


Alan

Accepted Answer

I just received an official response from Apple. They say that this is the intended behaviour. That's weird.


However, I still think it's a iOS 13 bug because if you assign an image (setIncrementImage or setDecrementImage) the component start to correctly respond to tintColor. You can even set it's default image!


So, in conclusion, if you want to change the tint color of a UIStepper in iOS13 you need to add these two lines of code:


stepper.setDecrementImage(stepper.decrementImage(for: .normal), for: .normal)
stepper.setIncrementImage(stepper.incrementImage(for: .normal), for: .normal)


Alan

I reported this just today. I don't see how this can be behaving correctly since it no longer uses the tint color for the border like it used to.


Very annoying

Yeah. Thats a bug regardless of what they say. it is nonsensical to set the image to the one it already has as a practice. I submitted a bug for it referencing this thread.
Thanks @DaleOne for finding a way to make it work.

Just ran into this. Thanks for the work-around.

well that saved my life - thanks!

UIStepper do not respect tint color in iOS 13
 
 
Q