开发者

How to know the pressed key in the keyboard in iPhone

开发者 https://www.devze.com 2023-03-07 16:02 出处:网络
I am new to iPhone. I\'d like to know the key pressed in the keyboard, and instead of the letter of the key I\'d like to insert another letter in UITextView.

I am new to iPhone. I'd like to know the key pressed in the keyboard, and instead of the letter of the key I'd like to insert another letter in UITextView.

So for this are there any methods which will be called when a key is pressed in the key board and the methods in which we can change the letter of that key, which will be written to the UITextView ?

Thanks i开发者_JS百科n advance.


The UITextViewDelegate Protocol provides a way of intercepting characters as the are typed using:

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text

at this point you can return NO and do your own text replacement.

0

精彩评论

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

关注公众号