ラジオボタンについては、ボタンにクラスを使用し、ボタンにはインジケータとしてラベルを使用しています。 これらは、これらが私のラジオボタンとすぐに私はどこかcheckedRadioのボタンのテキストを保存する必要があり、OKボタンを押すと、私はこのようにそれを行っているようラジオ付きテキストビューのIDを取得する方法ボタンをクリック
@IBOutlet weak var RadioBtnMonthly: SSRadioButton!
@IBOutlet weak var RadioBtnWeekly: SSRadioButton!
@IBOutlet weak var RadioBtnDefaultChecked: SSRadioButton!
@IBOutlet weak var RadioBtnDaily: SSRadioButton!
ある
@IBOutlet weak var TextViewEveryNewMessage: UILabel!
@IBOutlet weak var TextViewWeekly: UILabel!
@IBOutlet weak var TextViewDaily: UILabel!
@IBOutlet weak var TextViewMonthly: UILabel!
私のTextViewです。
@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