使用nib在iOS 9中调整自定义UIInputViewController的大小

使用nib在iOS 9中调整自定义UIInputViewController的大小,ios,swift,keyboard,inputview,uiinputviewcontroller,Ios,Swift,Keyboard,Inputview,Uiinputviewcontroller,在我的应用程序中,我使用的是自定义键盘。不是那种需要用户安装键盘,然后可以在任何地方使用它的应用程序扩展,只是在我的应用程序中 为此,我创建了UIInputViewController的子类,并在自定义nib文件中设置键盘。然后,在我要求显示此键盘的文本字段上,它调用UIInputViewController的inputView 这是调用键盘的代码: let myKeyBoard = MyKeyboard() scoreField.inputView = myKeyBoard.input

在我的应用程序中,我使用的是自定义键盘。不是那种需要用户安装键盘,然后可以在任何地方使用它的应用程序扩展,只是在我的应用程序中

为此,我创建了
UIInputViewController
的子类,并在自定义nib文件中设置键盘。然后,在我要求显示此键盘的文本字段上,它调用
UIInputViewController
的inputView

这是调用键盘的代码:

let myKeyBoard = MyKeyboard()    
scoreField.inputView = myKeyBoard.inputView!
scoreField.becomeFirstResponder()
然后,在UIInputViewController中,此代码被称为:

class MyKeyboard: UIInputViewController {
var myKeyBoardView: UIInputView!

override func viewDidLoad() {
    super.viewDidLoad()

    self.loadInterface()
}

func loadInterface() {
    //load nib and set in view
    let nib = UINib(nibName: "MyKeyboard", bundle: nil)
    myKeyBoardView = nib.instantiateWithOwner(self, options: nil)[0] as! UIInputView
    self.inputView = myKeyBoardView
    view.backgroundColor = myKeyBoardView.backgroundColor
}
这让您了解到目前为止我的代码是什么样子的。我现在要做的是将这个键盘的高度设置为一个自定义值,比如200。我已经扫描过谷歌,所以我找到的所有解决方案要么只是iOS 8,要么表示不使用nib文件。我认为在iOS 9中以及在nib中了解如何实现这一点会很有用

如何使用nib更改iOS 9中自定义UIInputViewController的高度?