Skip to content

Disable iOS UIDatePicker Keyboard #138

@llKoull

Description

@llKoull

Hello!

First of all, thank you for this fantastic library!

I just noticed today that if you open a UIDatePicker to select Hour and Minutes and you tap over a number, a keybaord appears and covers the picker. I saw that this iOS feature can be disabled doing something like this:

datePicker.addTarget(self, action: #selector(handleDatePickerTap(_:)), for: .editingDidBegin)

@IBAction func handleDatePickerTap(_ sender: UIDatePicker) {
        sender.resignFirstResponder()
}

But i'm not able to getting the real UIDatePicker from the ActionSheetDatePicker. I tried to do:

if let datePicker = datePicker?.configuredPickerView() as? UIDatePicker {
    datePicker.addTarget(self, action: #selector(handleDatePickerTap(_:)), for: .editingDidBegin)
}

But it does not seem to work. Do you know how can i disable this iOS feature?

Thanks and best regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions