2017-03-01 57 views
1

我通过子类UIInputViewController实现自定义键盘。iOS swift自定义键盘无法检测到keyboardType

我想为emailAddress实现键盘。

我的Xcode: - 8.1的iOS:-10.1快捷版: - 3.0

我试图代码,找出键盘类型

textDocumentProxy.keyboardType?.rawValue 
    (textDocumentProxy as UIKeyInput).keyboardType?.rawValue 

但是,这两条线送花儿给人给人0,其默认的键盘类型。

任何人都可以帮助我。

+0

是[这个问题/答案](http://stackoverflow.com/questions/42130932/ios-how-to-get-the-current-visible-keyboard-type/42131221#42131221)有用的你的情况? –

+0

看到这个http://stackoverflow.com/questions/26579056/ios-8-custom-keyboard-extension-uikeyboardtype –

回答

0

此处textfield是类textfield的对象。

textField.keyboardType = .emailAddress 
+0

这个问题是与extenson –

+0

有关对不起anshul,但我想找到键盘类型,我不想改变键盘类型。 –