I tried changing the colors of the text for a button, but it\'s still staying white.
isbeauty = UIButton()
isbeauty.setTitle(\"Buy\", forState: UIControlStat
This is swift 5 compatible answer. If you want to use one of the built-in colours then you can simply use
button.setTitleColor(.red, for: .normal)
If you want some custom colours, then create an extension for a UIColor as below first.
import UIKit
extension UIColor {
static var themeMoreButton = UIColor.init(red: 53/255, green: 150/255, blue: 36/255, alpha: 1)
}
Then use it for your button as below.
button.setTitleColor(UIColor.themeMoreButton, for: .normal)
Tip: You can use this method to store custom colours from rgba colour code and reuse it throughout your application.