代码拉取完成,页面将自动刷新
安装
pod 'XLConversationInputView'
初始化并展示
_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];
支持的子项
- (NSArray<XLCMoreItemTypeKey> *)supportMoreItem
{
return @[XLCMoreItemTypeKeyAlbum,
XLCMoreItemTypeKeyVoiceCall,
XLCMoreItemTypeKeyVideoCall,
XLCMoreItemTypeKeyFile,
XLCMoreItemTypeKeyLink,
XLCMoreItemTypeKeyApplets,
XLCMoreItemTypeKeyBusinessCard,
XLCMoreItemTypeKeyLocation];
}
子项结果的回调
- (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(@"");
}
}
需要显示的文件类型
- (NSArray<XLCFileTypeKey> *)supportFileTypes
{
return @[XLCFileTypeKeyWordDoc,
XLCFileTypeKeyWordDocx,
XLCFileTypeKeyExcelXls,
XLCFileTypeKeyExcelXlsx,
XLCFileTypeKeyPowerPointPpt,
XLCFileTypeKeyPowerPointPptx,
XLCFileTypeKeyZip,
XLCFileTypeKeyRar,
XLCFileTypeKeyText,
XLCFileTypeKeyTxt,
XLCFileTypeKeyLog,
XLCFileTypeKeyPdf];
}
扫描的文件目录
- (NSArray<NSString *> *)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;
}
录音参数
- (NSDictionary *)audioRecorderParameters
{
NSDictionary *parameters = @{
AVFormatIDKey: @(kAudioFormatLinearPCM),
AVSampleRateKey: @(16000.0),
AVNumberOfChannelsKey: @(1),
AVAudioFileTypeKey:@(kAudioFileWAVEType),
AVEncoderBitDepthHintKey: @(16),
AVEncoderAudioQualityKey: @(AVAudioQualityHigh)
};
return parameters;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。