2017-03-01 58 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,但我想找到鍵盤類型,我不想改變鍵盤類型。 –