When I dictate a text or words, the Siri receiver repeats in some way each captured word when I want to write in a UITextView, my UITextView is implemented as simple as possible:
So how can I detect if Siri Dictation was used for the UITextView,
Please any help?
Code Block #pragma mark - UITextViewDelegate - (BOOL) textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { return YES; } - (void)textViewDidChange:(UITextView *)textView { // NSLog(@"-> textViewDidChange: %@", textView.text); if (textView == self.txtViewItem) { if ([self sameCharsInString:textView.text]) { NSString *firstChar = [textView.text substringWithRange:NSMakeRange(0, 1)]; textView.text = firstChar; } if (textView.text.length > 1) { NSString * character = [textView.text substringWithRange:NSMakeRange(1, 1)]; textView.text = [textView.text stringByReplacingCharactersInRange:NSMakeRange(1, 1) withString:[character lowercaseString]]; } } } -(BOOL)sameCharsInString:(NSString *)str{ if ([str length] == 0 ) return NO; return [[str stringByReplacingOccurrencesOfString:[str substringToIndex:1] withString:@""] length] == 0 ? YES : NO; }
So how can I detect if Siri Dictation was used for the UITextView,
Please any help?