I have checked every possible thread before posting this question but couldn't find a good solution.
I have 5 textfields in my view, when selected the first 2 a keyboard should appear and when selected the last 3 my PickerView should appear. Everything works fine as I have used tags to identify my textfields and in the "textFieldShouldBeginEditing" I returned False for my last 3 textfields.
HOWEVER if I selected text field 2 and then move to text field 3,keyboard will appear OVER the picker view. I have tried using textFieldDidEndEditing but it didn't work.
Is there any other approaches to solve this problem?
I use addTarget on each textfield to call this function
func openDatesPicker() {
ActionSheetStringPicker.show(withTitle: "Appointment Date", rows: datesArray , initialSelection: selectedDateIndex , doneBlock: {
picker, value, index in
self.selectedDateIndex = value
if let selected = index as? String{
self.dateTF.text = selected
let timeIndex = self.findEarliestTime(date: self.dateTF.text!)
self.timeTF.text = timeIndex
}
return
}, cancel: { ActionStringCancelBlock in return }, origin: self.view)
}