I use (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)
to perform real-time regex validation on every character input into a UITextView
.
This works well and even handles pasted text that might contain invalid characters.
But Siri doesn't seem to care for such things and dumps its dictation straight into (void)textViewDidChange:(UITextView *)theTextView
, bypassing the shouldChangeTextInRange
delegate and avoiding validation checks.
This seems like a security flaw to me and breaks the API flow that every other input channel follows.
Any thoughts as to how I can get Siri Dictation to comply with calling shouldChangeTextInRange
?