Reputation: 348
I am making a script to allow users to change element colors.
The script is designed to work on the text in buttons.
I have tried this:
func prettyText(_ button: RoundButton, colour: UIColor) {
button.textColor = colour
}
but it gives this error:
Value of type 'RoundButton' has no member 'textColor'; did you mean 'tintColor'?
Upvotes: 0
Views: 66
Reputation: 3410
UIButton
has setTitleColor(_:for:) method. So in your case
func prettyText(_ button: RoundButton, colour: UIColor) {
button.setTitleColor(colour, for: .normal)
}
Upvotes: 2