# XLConversationInputView **Repository Path**: ilongge/XLConversationInputView ## Basic Information - **Project Name**: XLConversationInputView - **Description**: XLConversationInputView - **Primary Language**: Objective-C - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-08-02 - **Last Updated**: 2025-01-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # XLConversationInputView 安装 ```ruby pod 'XLConversationInputView' ``` 初始化并展示 ```Objective-C _inputViewHeight = 49; CGRect rect = CGRectMake(0, self.view.frame.size.height - _inputViewHeight, self.view.frame.size.width, _inputViewHeight); NSString *mapAPIKey = @""; NSString *mapSearchKeyapiKey = @""; self.inputView = [[XLConversationInputView alloc] initWithFrame:rect andMapKitKey:mapAPIKey andMapSearchKey:mapSearchKeyapiKey]; [self.view addSubview:self.inputView]; self.inputView.inputViewHeightBlock = ^(CGFloat height) { }; [self.inputView showInputView]; ``` 支持的子项 ```Objective-C - (NSArray *)supportMoreItem { return @[XLCMoreItemTypeKeyAlbum, XLCMoreItemTypeKeyVoiceCall, XLCMoreItemTypeKeyVideoCall, XLCMoreItemTypeKeyFile, XLCMoreItemTypeKeyLink, XLCMoreItemTypeKeyApplets, XLCMoreItemTypeKeyBusinessCard, XLCMoreItemTypeKeyLocation]; } ``` 子项结果的回调 ```Objective-C - (void)selectItemKey:(XLCMessageContentTypeKey)itemKey andValue:(id)value { if ([itemKey isEqualToString:XLCMessageContentTypeKeyText]) { } else if ([itemKey isEqualToString:XLCMessageContentTypeKeyAttributedText]) { } else if ([itemKey isEqualToString:XLCMessageContentTypeKeyAlbum]) { } else if ([itemKey isEqualToString:XLCMessageContentTypeKeyVideo]) { } else if ([itemKey isEqualToString:XLCMessageContentTypeKeyVoice]) { } else if ([itemKey isEqualToString:XLCMessageContentTypeKeyVoiceCall]) { } else if ([itemKey isEqualToString:XLCMessageContentTypeKeyVideoCall]) { } else if ([itemKey isEqualToString:XLCMessageContentTypeKeyFile]) { } else if ([itemKey isEqualToString:XLCMessageContentTypeKeyLink]) { } else if ([itemKey isEqualToString:XLCMessageContentTypeKeyApplets]) { } else if ([itemKey isEqualToString:XLCMessageContentTypeKeyBusinessCard]) { } else if ([itemKey isEqualToString:XLCMessageContentTypeKeyLocation]) { } else if ([itemKey isEqualToString:XLCMessageContentTypeKeyAtSomeone]) { NSLog(@""); } } ``` 需要显示的文件类型 ```Objective-C - (NSArray *)supportFileTypes { return @[XLCFileTypeKeyWordDoc, XLCFileTypeKeyWordDocx, XLCFileTypeKeyExcelXls, XLCFileTypeKeyExcelXlsx, XLCFileTypeKeyPowerPointPpt, XLCFileTypeKeyPowerPointPptx, XLCFileTypeKeyZip, XLCFileTypeKeyRar, XLCFileTypeKeyText, XLCFileTypeKeyTxt, XLCFileTypeKeyLog, XLCFileTypeKeyPdf]; } ``` 扫描的文件目录 ```Objective-C - (NSArray *)fileListDirectory { NSMutableArray *fileListDirectoryArray = [NSMutableArray array]; NSString *path1 = [NSString stringWithFormat:@"%@/Library/Caches/cache1", NSHomeDirectory()]; NSString *path2 = [NSString stringWithFormat:@"%@/Library/Caches/cache2", NSHomeDirectory()]; [fileListDirectoryArray addObject:path1]; [fileListDirectoryArray addObject:path2]; return fileListDirectoryArray; } ``` 录音参数 ```Objective-C - (NSDictionary *)audioRecorderParameters { NSDictionary *parameters = @{ AVFormatIDKey: @(kAudioFormatLinearPCM), AVSampleRateKey: @(16000.0), AVNumberOfChannelsKey: @(1), AVAudioFileTypeKey:@(kAudioFileWAVEType), AVEncoderBitDepthHintKey: @(16), AVEncoderAudioQualityKey: @(AVAudioQualityHigh) }; return parameters; } ``` ![iPhone 8 - 2022-08-12 at 10.59.02.png](https://s2.loli.net/2022/08/12/gxXNtlcrB4PzvmU.png) ![iPhone 8 - 2022-08-12 at 10.59.07.png](https://s2.loli.net/2022/08/12/zVODbnBpWkg6RQ1.png) ![iPhone 8 - 2022-08-12 at 10.59.11.png](https://s2.loli.net/2022/08/12/VCcEhH7Nao6WpFJ.png)