How can I set UIPickerView at other than the default index? How can I set UIPickerView at other than the default index? ios ios

How can I set UIPickerView at other than the default index?


Assuming your picker is referred to in a property "myPicker", then in viewDidLoad, go:

[self.myPicker selectRow:rowInt inComponent:componentInt animated:NO]


Update for Swift 4.2:

To set the default row in a UIPickerView,

  myPicker.selectRow(5, inComponent: 0, animated: true)

where myPicker is the name of the UIPickerView and 5 is the index of the desired row.