发送文本处理ui和逻辑

This commit is contained in:
2026-01-29 17:56:53 +08:00
parent b556e6841d
commit d0c5cada35
3 changed files with 193 additions and 81 deletions

View File

@@ -46,6 +46,9 @@ typedef NS_ENUM(NSInteger, KBVoiceInputBarState) {
/// 代理
@property (nonatomic, weak) id<KBVoiceInputBarDelegate> delegate;
/// 文本发送回调(文本模式下发送消息时触发)
@property (nonatomic, copy) void (^onTextSend)(NSString *text);
/// 状态文本(显示在按钮上方)
@property (nonatomic, copy) NSString *statusText;

View File

@@ -408,8 +408,10 @@
}
- (void)handleTextCenterTap {
self.inputState = KBVoiceInputBarStateText;
[self.hiddenTextField becomeFirstResponder];
// VC
if (self.onTextSend) {
self.onTextSend(nil);
}
}
- (void)handleVoiceLongPress:(UILongPressGestureRecognizer *)gesture {