iOS swift自定义键盘未检测到keyboardType

时间:2017-03-01 07:51:08

标签: ios iphone swift xcode

我通过对UIInputViewController进行子类化来实现自定义键盘。

我想为emailAddress实现键盘。

我有Xcode: - 8.1 iOS:-10.1和swift版本: - 3.0

我正在尝试找到keyboardType

的代码
  textDocumentProxy.keyboardType?.rawValue
  (textDocumentProxy as UIKeyInput).keyboardType?.rawValue

但这两行总是给出0即默认键盘类型。

任何人都请帮助我。

1 个答案:

答案 0 :(得分:0)

这里textfield是类textfield的对象。

textField.keyboardType = .emailAddress