处理ios18从其他app用自己键盘 拉起主app的bug

其他问题
This commit is contained in:
2025-11-24 19:58:19 +08:00
parent 8e93f8f86f
commit 15e37841bb
20 changed files with 264 additions and 88 deletions

View File

@@ -138,6 +138,10 @@
_q1Label.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
_q1Label.textColor = [UIColor blackColor];
_q1Label.text = KBLocalized(@"What are you doing?");
//
_q1Label.userInteractionEnabled = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(kb_onTapQ1)];
[_q1Label addGestureRecognizer:tap];
}
return _q1Label;
}
@@ -148,8 +152,29 @@
_q2Label.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
_q2Label.textColor = [UIColor blackColor];
_q2Label.text = KBLocalized(@"I'm going to take a shower.");
//
_q2Label.userInteractionEnabled = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(kb_onTapQ2)];
[_q2Label addGestureRecognizer:tap];
}
return _q2Label;
}
///
- (void)kb_copyTextToPasteboard:(NSString *)text {
if (text.length == 0) { return; }
UIPasteboard.generalPasteboard.string = text;
[KBHUD showInfo:KBLocalized(@"Copy Success")];
}
///
- (void)kb_onTapQ1 {
[self kb_copyTextToPasteboard:self.q1Label.text];
}
///
- (void)kb_onTapQ2 {
[self kb_copyTextToPasteboard:self.q2Label.text];
}
@end