UUChatTableView
Cocoa UI component for group or private chat bubbles with text, images and audio support
Install / Use
/learn @ZhipingYang/UUChatTableViewREADME
UUChatTableView
Cocoa UI component for chat bubbles with text, images and audio support
GIF 动画演示
<p align="center"><img width="250" src ="https://github.com/ZhipingYang/UUChatTableView/raw/master/Demo/UUChatTableViewTests/ChatTableView.gif"/></p>截图 - ScreenShot
<p align="center"> <img width=33% alt="wx20170601-170002 2x" src="https://github.com/ZhipingYang/UUChatTableView/raw/master/Demo/UUChatTableViewTests//ScreenShot/QQ20150113-5.jpg"> <img width=33% alt="wx20170601-170002 2x" src="https://github.com/ZhipingYang/UUChatTableView/raw/master/Demo/UUChatTableViewTests//ScreenShot/QQ20150113-4.jpg"> <img width=33% alt="wx20170601-170002 2x" src="https://github.com/ZhipingYang/DataResource/raw/master/UUChat/IMG_0054.jpg"> </p>群聊(GroupChat)效果图(新添UI细节)
使用类介绍 - Introduce
类名 | 作用及用法 ----- | ----- UUMessage | 内容数据Model,储存文字、语音、头像、图片、时间等等 UUMessageFrame | cell的model,设置气泡聊天的布局 UUMessageCell | 呈现UI,并做cell的事件处理(语音、图片、头像点击) UUMessageContentButton | 气泡内容的封装及copy功能 UUInputFunctionView | tableView底部的视图,相当于ToolBar UUImageAvatarBrowser | 放大图片功能,其实这是障眼法详细查看 UUAVAudioPlayer | 语音功能封装,实现本地和线上URL播放,缺点是还没有做像SDWebImage那样的本地缓存 UUProgressHUD | Window层上得HUD,功能简易
第三方库 | 说明 ----- | ----- MJRefresh | 下拉加载更多聊天记录 AFNetworking | 仅使用UIKit+AFNetworking,类似 SDWebImage VoiceLib | 忘记了来自哪里的,找半天没有找到。语音录入及格式转化成MP3
使用方法 - Usage
声明一下|
----- | -----
当前的数据是在固定模式下随机模拟的,不包含用户输入的所有可能性|
有不习惯Xib编程的有问题可以问我,以前我因为不会而不想去改变 |
我还没有去试iOS6下得适配,要是你测试过油问题可以修改提交或者告诉我 |
有人提到群聊功能,只需要在getDic方法添加其他人信息即可点击查看|
感谢丁南修复语音播放及其他的一些bug|
添加代理
UUInputFunctionViewDelegate
// 返回文字内容
- (void)UUInputFunctionView:(UUInputFunctionView *)funcView sendMessage:(NSString *)message;
// 返回图片数据
- (void)UUInputFunctionView:(UUInputFunctionView *)funcView sendPicture:(UIImage *)image;
// 返回语音数据和录音时长
- (void)UUInputFunctionView:(UUInputFunctionView *)funcView sendVoice:(NSData *)voice time:(NSInteger)second;
UUMessageCellDelegate
//cell的头像点击
- (void)headImageDidClick:(UUMessageCell *)cell userId:(NSString *)userId;
//图片点击可有可无
- (void)cellContentDidClick:(UUMessageCell *)cell image:(UIImage *)contentImage;
Swift版
Swift2.0版将完全使用autolayout(storyboard或code)。
