修改逻辑

This commit is contained in:
2025-10-30 18:28:36 +08:00
parent 482756f6f0
commit 4f23118ec0

View File

@@ -234,29 +234,26 @@ static NSString * const kKBFunctionTagCellId = @"KBFunctionTagCellId";
}
- (void)onTapDelete {
NSLog(@"点击:删除");
// 宿 App
UIInputViewController *ivc = [self findInputViewController];
id<UITextDocumentProxy> proxy = ivc.textDocumentProxy;
[proxy deleteBackward];
}
- (void)onTapClear {
NSLog(@"点击:清空");
//
// pasteView
UIInputViewController *ivc = [self findInputViewController];
id<UITextDocumentProxy> proxy = ivc.textDocumentProxy;
//
NSInteger guard = 0;
while (proxy.hasText && guard < 10000) { //
// documentContextBeforeInput 50
NSInteger guard = 0; //
while (guard < 10000) {
NSString *before = proxy.documentContextBeforeInput ?: @"";
// before
NSInteger count = before.length > 0 ? before.length : 1;
NSInteger count = before.length;
if (count <= 0) { break; } //
for (NSInteger i = 0; i < count; i++) {
[proxy deleteBackward];
}
guard += count;
}
//
self.pasteView.placeholderLabel.text = @"点击粘贴TA的话";
}
- (void)onTapSend {
NSLog(@"点击:发送");