setTitleColor not working for UIButton plain style

If I create a Plain style UIButton using the Storyboard, calling the function setTitleColor(_ color: UIColor?, for state: UIControl.State) stop working, or works in a limited way.

However, the color of the title can still be modified using its titleLabel?.tintColor property.

If I turn UIButton to be Default style, then setTitleColor(_ color: UIColor?, for state: UIControl.State) works as expected.

Thank you

Mauro Bianchelli.

If I turn UIButton to be Default style, then setTitleColor(_ color: UIColor?, for state: UIControl.State) works as expected.

You gave the answer.

If you use a style, you have to use configuration: https://sarunw.com/posts/how-to-mark-custom-button-style-with-uibuttonconfiguration/

But then, you cannot have a multiline button.

setTitleColor not working for UIButton plain style
 
 
Q