When long pressing delete button on system keyboard, UITextView's delegate method textView:shouldChangeTextInRange:replacementText:
is only called once for the first charater
Code to reproduce
- (void)viewDidLoad {
[super viewDidLoad];
UITextView *textView = [[UITextView alloc] initWithFrame:self.view.bounds];
textView.delegate = self;
[self.view addSubview:textView];
}
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
NSLog(@"%@, %@", NSStringFromSelector(_cmd), NSStringFromRange(range));
return YES;
}
Output on iOS17 beta
Output on iOS16.3.1