Reputation: 2830
I am trying to place two picker views in one view controller. I have implemented both pickerView:viewForRow:
and pickerView:titleForRow:
. These functions use tags to differentiate between pickers. My problem is that only one of them will be effective. So, because I want views in one and text in the other, but it will be the case that either both get views or both get text. Can I use the pickerView:titleForRow:
function on one and pickerView:viewForRow:
for the other?
Upvotes: 0
Views: 91
Reputation: 114783
Unfortunately you can't use both pickerView:viewForRow
and pickerView:titleForRow
at the same time in the same UIPickerViewDelegate
. While pickerView:titleForRow
returns String?
, giving the option of returning nil, pickerView:viewForRow
does not return an optional; if you implement this function then it must return a view.
This leaves you with two options:
pickerView:viewForRow
Upvotes: 1