对于radiobuttons我已经在按钮中使用类和指示器按钮我已经使用了标签。 这些都是我的TextView我如何获得单选按钮的文本视图的ID点击
@IBOutlet weak var TextViewEveryNewMessage: UILabel!
@IBOutlet weak var TextViewWeekly: UILabel!
@IBOutlet weak var TextViewDaily: UILabel!
@IBOutlet weak var TextViewMonthly: UILabel!
这些都是我的单选按钮
@IBOutlet weak var RadioBtnMonthly: SSRadioButton!
@IBOutlet weak var RadioBtnWeekly: SSRadioButton!
@IBOutlet weak var RadioBtnDefaultChecked: SSRadioButton!
@IBOutlet weak var RadioBtnDaily: SSRadioButton!
只要我按ok键,我需要保存在某个地方的checkedRadio按钮的文字和我都做到了这个样子。
@IBAction func OkButton(sender: UIButton) {
SwiftSpinner.show(kLoadingText)
if RadioBtnDefaultChecked.selected{
preferencesConditions.notificationFrequency = self.TextViewEveryNewMessage.text
}else if RadioBtnDaily.selected{
preferencesConditions.notificationFrequency = self.TextViewDaily.text
}else if RadioBtnWeekly.selected{
preferencesConditions.notificationFrequency =
self.TextViewWeekly.text
}else{
preferencesConditions.notificationFrequency = self.TextViewMonthly.text
}
这是我正在做的正确方法。还是有其他方法。请建议我。
所以你的UI加入了textview和Radiobutton。 –
对于这种情况,我更喜欢完成块。 – Jageen