3

I am implementing Custom keyboard by sub-classing UIInputViewController.

i want to implement keyboard for emailAddress.

I have Xcode :- 8.1 iOS :-10.1 and swift version :- 3.0

I am trying code to find keyboardType

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

But this two lines alway giving 0 that is Default keyboard type.

any one help me please.

  • Is [this question/answer](http://stackoverflow.com/questions/42130932/ios-how-to-get-the-current-visible-keyboard-type/42131221#42131221) useful to your case? – Ahmad F Mar 01 '17 at 07:57
  • see this http://stackoverflow.com/questions/26579056/ios-8-custom-keyboard-extension-uikeyboardtype – Anbu.Karthik Mar 01 '17 at 08:00

1 Answers1

0

here textfield is object of class textfield.

textField.keyboardType = .emailAddress
anshul king
  • 558
  • 4
  • 17