I'm trying to follow this guide, but using swift: InputAccessoryView docked at bottom
I can't seem to set the inputAccessoryView for my ViewController, according to the documentation, I need to redeclare it:
The value of this read-only property is nil. If you want to attach custom controls to a system-supplied input view (such as the system keyboard) or to a custom input view (one you provide in the inputView property), redeclare this property as read-write in a UIResponder subclass. You can then use this property to manage a custom accessory view. When the receiver becomes the first responder, the responder infrastructure attaches the accessory view to the appropriate input view before displaying it.
I can't figure out how to do this using swift. Any help is greatly appreciated.
Old question but this may be of use to those not overly familiar with Objective-C.
I'm not sure how to achieve this with swift alone but it's easy enough to do the "dirty work" in objective c land and utilise the result in swift
Process
This approach requires 3 files to be added to your project.
Enjoy
.h file
.m file
Bridging Header
In the "YOUR_PROJECT_NAME-Bridging-Header.h" (or whatever its called in the Objective-C Bridging Header property in build settings of your project (SWIFT_OBJC_BRIDGING_HEADER)
Swift Demo