i'm using https://github.com/shamasshahid/SSRadioButtonsController . when i add radio buttons through storyboard and set titles it works fine but when i try to add set title of radio button through code it doesn't work.
class ViewController: UIViewController, SSRadioButtonControllerDelegate {
var radioButtonController: SSRadioButtonsController?
override func viewDidLoad() { super.viewDidLoad()
var buttonArray = [UIButton]()
let radioButton = SSRadioButton(frame: CGRect(x: 20, y: 20, width: 20, height: 20 ))
radioButton.circleRadius = 8
radioButton.setTitle("male", forState: .Normal)
let radioButton1 = SSRadioButton(frame: CGRect(x: 20, y: 60, width: 20, height: 20 ))
radioButton.circleRadius = 8
radioButton.setTitle("female", forState: .Highlighted)
self.view.addSubview(radioButton)
self.view.addSubview(radioButton1)
buttonArray.append(radioButton)
buttonArray.append(radioButton1)
radioButtonController = SSRadioButtonsController(buttons: buttonArray)
radioButtonController!.delegate = self
radioButtonController!.shouldLetDeSelect = true
// Do any additional setup after loading the view, typically from a nib.
}
func didSelectButton(aButton: UIButton?) {
print(aButton)
}
}
20to150- Anbu.Karthik