聊天界面封装,快速开发。(高度自定义)
//------子类可以重写/外部调用------
// 添加表情面板
func efAddFacePanelView() -> UIView {
let faceView:YLFaceView = Bundle.main.loadNibNamed("YLFaceView", owner: self, options: nil)?.first as! YLFaceView
faceView.delegate = self
return faceView
}
// 添加更多面板
func efAddMorePanelView() -> UIView {
let panelView = UIView()
panelView.backgroundColor = UIColor.white
let imageView = UIImageView()
imageView.image = UIImage(named: "btn_import_photo")
panelView.addSubview(imageView)
imageView.snp.makeConstraints { (make) in
make.top.equalTo(20)
make.left.equalTo(40)
make.width.height.equalTo(55)
}
imageView.isUserInteractionEnabled = true
imageView.addGestureRecognizer(UITapGestureRecognizer.init(target: self, action: #selector(YLReplyView.efHandlePhotos)))
return panelView
}
// 已经恢复普通状态
func efDidRecoverReplyViewStateForNormal() {}
// 已经恢复编辑状态
func efDidRecoverReplyViewStateForEdit() {}
// 收起输入框
func efPackUpInputView() {
updateReplyViewState(YLReplyViewState.normal)
}
// 发送消息
func efSendMessageText(_ text: String) {}
func efSendMessageImage(_ images: [UIImage]?) {}
func efSendMessageVoice(_ path: String?,duration: Int){}