I have the following set up for my UIToolBar / Accessory View on a view controller
@IBOutlet var inputFieldView: UIToolbar!
override var canBecomeFirstResponder:
This is a known bug on iOS 11. UIToolbar subviews don't get the touch events because some internal views to the toolbar aren't properly setup.
The current workaround is to call toolBar.layoutIfNeeded() right before adding subviews.
In your case:
inputFieldView.layoutIfNeeded()
Hopefully this will get fixed on the next major version.