Git Product home page Git Product logo

talk-ios's Introduction

简聊 iOS

如果不想自己部署本地服务,可以直接下载 App: https://itunes.apple.com/cn/app/id922425179,

安装之前

  • 搭建本地服务: 具体介绍请参考 talk-os

  • 打开工程,全局搜索 "http://192.168.0.35:7001", 将服务器地址替换成自己部署的服务器地址

  • pod install

  • 运行代码(真机调试可以使用 Apple 提供的证书,)

代码简介

  • 代码主体由 OC 编写,登录部分由 Swift 编写
  • 大部分 采用 MVC 的架构,登录部分 采用 MVVM 架构
  • 网络层是对 AFNetWorking 的封装
  • 数据层采用 CoreDataMargicalRecordMantle(因为性能的关系,部分地方是采用了 FastEasyMapping
  • UI 层主要由 StoryBoard 构建

关于聊天

IM 是简聊的核心,iOS 端聊天的处理,希望可以为其他后来 IM 提供经验。具体逻辑如下:

  • 消息的接收相关主要由 SocketManager 负责处理
  • 消息的发送相关主要由 MessageSendEngine 负责处理

彼此互不干扰,可以很好的处理各种情况。

聊天界面的渲染主要是使用 UITableView,每条消息其实是 一个 section,这样可以处理各种复杂的附件消息组合。

talk-ios's People

Contributors

suricforever avatar

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.