Мне нужна помощь. Я искал решение в течение двух дней.
class Mam_sEntre_eViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate {
let notes = [0, 1, 2, 3, 4, 5]
@IBOutlet weak var noteGoutPickerView: UIPickerView!
@IBAction func validate() {
validateNoteMam_sEntre_e()
}
func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 1
}
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return notes.count
}
private func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> Int? {
return notes[row]
}
private func validateNoteMam_sEntre_e() {
let noteGoutIndex = noteGoutPickerView.selectedRow(inComponent: 0)
let noteGout = notes[noteGoutIndex]
}
}