Now I have a question is about how to observer keyboard touch in iOS.for example, if I click the 'A','B',or any key in keyboard ,how can I monitor it.I try to add an gestureRecognizer in keyboard. I can monitor it in iOS 7, iOS 9.In iOS 10, it can't work.I don't know why,so I look for another way to implement the function.
Asked
Active
Viewed 201 times
1 Answers
0
You can get entered character from
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool { Print(string) Return true }
Delegate method. You must need to set delegate of textfield you are entering text to.

Jitendra Tanwar
- 249
- 2
- 11
-
Yes, I know.But this only works when you click some keys,such as letters. I want to monitor the voice key if I can. I don't need to know which key clicked, but I need to do something after I click the keyboard keys. – yan.zhao May 22 '17 at 02:40
-
Then checkout this , i didn't try it for voice comand but it may work. http://stackoverflow.com/questions/9268045/how-can-i-detect-that-the-shift-key-has-been-pressed – Jitendra Tanwar May 22 '17 at 04:04