Hi, I'm writing a code with a UIPickerView that has 3 components. I want each component to have a different row height. Obviously I tried to use pickerView(_:rowHeightForComponent:), but it turns out that rowHeightForComponent sometimes equals to the number of components, i.e. in my case is sometimes equals 3. So I actually get a component index that is not valid. Did anyone have the same problem? Is it a known bug?
This is the code of the method:
func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
componentsRowHeight[component]
}
Because I have 3 components, which are held in an array, the valid indices are 0, 1, 2. But the delegate function is sometimes called with 3.