I have a simple UIInputViewController subclass with only two overridden methods. I use this input view controller as inputAccessoryViewController on my UIViewContro
inputAccessoryViewController
Since iOS 9.0 this can be solved with inputView.allowsSelfSizing = YES;
inputView.allowsSelfSizing = YES;