Quantcast
Channel: Active questions tagged uipickerview - Stack Overflow
Viewing all articles
Browse latest Browse all 594

How to Scroll to Specific Row in UIPickerView In iOS Swift 3

$
0
0

I have a UIPickerView with values 0...250. There is 2 Components in UIPickerView. In First component i am displaying these values. but i want to detect scrolling method of the UIPickerView. because when pickerView appears the value I would like to display is 75. means pickerView is scroll to row number 75. and user can scroll up and down the picker with values 0...250. I have tried this code in UIPickerViewtitleForRow row: Int method

pickerView.selectRow(75, inComponent: 0, animated: true)

in this case when pickerView appears the selected value is 75. Below is exactly what i want

enter image description here

but the problem is that on scrolling pickerView my app crash with following error

[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]'

anyone help me please thanks in advance :-)


Viewing all articles
Browse latest Browse all 594

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>