Selecting first row in UIPickerView issue

2 Solutions Collect From Internet About “Selecting first row in UIPickerView issue”

Just replace didSelect method in your sample code like as bellowed. it will working fine.

@IBAction func doneBtn(sender: AnyObject) {

        var row = pickerView.selectedRowInComponent(0);
        NSLog("value L %d", row)
        pickerView(pickerView, didSelectRow: row, inComponent:0)
    }

Hope this help you.

In the titleForRow function add this line of code. It shows first row selected:

textField.text = pickerArray.objectAtIndex(row).objectForKey("Name") as? String