开发者

track user input from UIKeyboard

开发者 https://www.devze.com 2023-01-14 05:51 出处:网络
How can I get user input of the UIKeyboard on the iPhone? I want to track, if the user hits \"backspace\" when the firstResponder UITextField is empty.

How can I get user input of the UIKeyboard on the iPhone? I want to track, if the user hits "backspace" when the firstResponder UITextField is empty. I know how I can track a text change but if the field is empty the text don't chang开发者_如何转开发e when hit "backspace".


You can put a single space character as the default textfield text. If it tries to disappear in your textshouldchange delegate then the user hit a backspace. You can remove the leading space before actually using the text result.

0

精彩评论

暂无评论...
验证码 换一张
取 消