Input Accessory View On Keyboard for New Time Picker

Viewed 122

Is it possible to add an input accessory view to the number pad that acts as the input view for the new iOS 14 style of time picker? I want the time picker to remain inline, and I'm keeping it as the displayer of the time as well, so no UITextField is being fed.

There is a .inputAccessoryView variable for the new time picker, but it can't be overridden.

For example,

    let timePicker = UIDatePicker()
    timePicker.datePickerMode = .time
    timePicker.preferredDatePickerStyle = .inline

    timePicker.inputAccessoryView = toolbar      // this doesn't work

Wondering if there may be a way to get around this, like possibly pinning a view to the keyboard manually, but can't figure out how to do this. Any thoughts/ideas/workarounds on this?

0 Answers
Related