Swift 4: Делегаты представления средства выбора:
optional public func pickerView(_ pickerView: UIPickerView, titleForRow row:
Int, forComponent component: Int) -> String?
Пример:
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int,
forComponent component: Int) -> String? {
let value = dummyListArray[row]
if value == "someText"{
//Perform Action
}
return value
}
Или
optional public func pickerView(_ pickerView: UIPickerView, didSelectRow row:
Int, inComponent component: Int)
Пример:
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int,
inComponent component: Int) {
let value = dummyListArray[row]
if value == "someText"{
//Perform Action
}
}