处理ios18从其他app用自己键盘 拉起主app的bug
其他问题
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user