I tried changing the colors of the text for a button, but it\'s still staying white.
isbeauty = UIButton()
isbeauty.setTitle(\"Buy\", forState: UIControlStat
referring to radio buttons ,you can also do it with Segmented Control as following:
step 1: drag a segmented control to your view in the attribute inspector change the title of the two segments ,for example "Male" and "Female"
step 2: create an outlet & an action for it in the code
step 3: create a variable for future use to contain choice's data
in the code do as following:
@IBOutlet weak var genderSeg: UISegmentedControl!
var genderPick : String = ""
@IBAction func segAction(_ sender: Any) {
if genderSeg.selectedSegmentIndex == 0 {
genderPick = "Male"
print(genderPick)
} else if genderSeg.selectedSegmentIndex == 1 {
genderPick = "Female"
print(genderPick)
}
}