Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @property int isTyping;
- - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
- [self startTyping];
- [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(stopTyping) object:nil];
- [self performSelector:@selector(stopTyping) withObject:nil afterDelay:0.5];
- return YES;
- }
- - (void)startTyping {
- if (self.isTyping==0) {
- self.isTyping=1;
- [self sendTypingStartData];
- }
- }
- - (void)stopTyping {
- self.isTyping=0;
- [self sendTypingStopData];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement