Search code examples
swift3uipickerview

Editing the UIPickerView


I have successfully performed UIPickerView. The row gets selected from UIPickerView and gets passed to textField. After this, I want to choose options again. But when I tap the pickerView, it doesn't get popped up.I can only choose once but I need it to perform as many times as user wants.I couldn't find the solution for Swift3. Please help me sort out this in Swift 3.


Solution

  • You need to check this func, insted of textField You have to Unhide PickerView

    func textFieldDidBeginEditing(_ textField: UITextField) {
        if textField == self.textField {
            //self.textField.isHidden = false
            self.pickerView.isHidden = false
            textField.endEditing(true)
    }