How can I get the selected value of a UIPickerViewControl in Swift?
I tried something like this:
labelTest.text = Spinner1.selectedRowInComponent(0).desc
Swift 4
let selectedYearPicker = pickerData[yearPicker.selectedRow(inComponent: print(selectedYearPicker)
Or
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { let yearValueSelected = pickerData[row] as String print(yearValueSelected) }