Code Monkey home page Code Monkey logo

ylbasechat's Introduction

YLBaseChat ---

  • 聊天界面封装,快速开发。
  • 目前支持文字、图片、语音     (遇到疑问可联系QQ:845369698)(后期准备用swift写一个对应的后台)
  • 为了能让用户高度自定义,我没有加入Cocoapods,项目结构也很简单。BaseChatVC 聊天界面控制器。YLReplyView 输入框的封装。            
  • 你只要写一个类似于ChatView的UIView 继承YLReplyView。然后添加到BaseChatVC 上就行。

图片

//------子类可以重写/外部调用------
// 添加表情面板
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){}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.