I want to change the tint color of a button.
button.setTitle("✸", for: .normal)
button.setTitleColor(.green, for: .normal)
This is working fine with the code above. However when I remove the first line (setTitle), it does not work anymore.
I have set a title for the button in the interfacebuilder/storyboard. I can't figure out what is the reason for that.
More research. Just one of these options work when the title is set via the interface builder. But when I change the title of the Button, option2 does not longer work.
// option 1
button.setTitle("✸", for: .normal)
button.setTitleColor(.green, for: .normal)
// option 2
button.tintColor = .red