I have a UITextField class which confirms to following delegates. I'm using this class as a global class (its a small custom library, which I'm using as a spinner).
//MARK: PickerView Delegate
func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return pickerDataArray![row]
}
func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
self.text = pickerDataArray![row]
}
//MARK: TextField Delegate
func textFieldDidBeginEditing(textField: UITextField) {
let row = self.pickerView.selectedRowInComponent(0)
self.text = self.pickerDataArray![row]
}
Now, I want to get the selected row, which in this class will be didSelectRow() func. So, how would I be able to use these functions in some way in those classes, where I implemented it?
You can do it using create Base class and extends in ChildClass or whenever you want to use
example:
SuperBaseViewController Class
SubViewController Class