GithubHelp home page GithubHelp logo

xingzhaodev / wechat-swiftui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lebron1992/wechat-swiftui

0.0 0.0 0.0 59.96 MB

用 SwiftUI 仿写的微信。

License: MIT License

Ruby 0.10% Swift 99.87% Makefile 0.04%

wechat-swiftui's Introduction

WeChat-SwiftUI

本项目已使用 The Composable Architecture 重构,最新代码在 composable-architecture 分支。

用 SwiftUI 仿写的微信。

虽然只是一个仿写的项目,但我还是按照实际生产开发的要求去编写,而不仅仅是停留在简单的 UI 层面。

本项目的目标是尽量使用纯 SwiftUI 框架来实现。如果 SwiftUI 暂时还不支持的,我们先不实现,等 SwiftUI 支持了再实现。

预览图

核心架构 Redux

Redux 在 React 项目中使用非常广泛。而 SwiftUI 声明式编程的理念与 React 非常类似。所以在 SwiftUI 中使用 Redux 再合适不过了。什么是 Redux?如何实现 Redux?可以去看我之前写的一篇文章 《在 SwiftUI 中实现 Redux》

本项目就使用了 Redux 架构,相关的文件在 Redux 文件夹下。

多语言的处理

本项目多语言的处理参考了 Kickstarter iOS 中的方法。使用 bin/strings-script 脚本和 ExternalResources/locales.json 自动生成多语言文件和 Strings 类型。需要添加新的语句时,只需要在 locales.json 添加对应的翻译,然后执行 make strings 命令,就可以在项目中使用 Strings.xxx() 得到当前语种的语句。

单元测试

本项目包含了大量的单元测试,以保证关键逻辑的准确性。

第三方库

数据的模拟

本项目的用户注册与登录、聊天、联系人和个人信息等都通过 Google 的 Firebase 实现,尽量模拟实际开发的逻辑。

已实现的功能

  • 注册和登录

  • 聊天

    • 私聊:可以在联系人中找实际存在的用户聊天(除 Lebron James 外,其他NBA 球员是假数据)
    • 可以发送文字、图片和表情
    • 点击图片查看大图
  • 联系人

    • 列表
    • 使用右边的索引滚动列表
    • 搜索
    • 详情页
  • 发现

    • 列表
    • 查看和修改个人信息:头像、名字、性别和个性签名。

运行项目

本项目因为使用了 Google 的 Firebase,所以**大陆用户运行前请连接 VPN。

测试账号:[email protected] / 11111111。

添加新功能

如果您乐意为本项目添加新功能,我非常欢迎。请使用 GitHub Issues 写出自己想要做的功能,实现以后提交 PR。

我有代码洁癖,很注重代码的简洁性和可读性。在写代码的时候请按照我的风格来。如果觉得在代码中有地方可以改进的,欢迎指出。谢谢!

wechat-swiftui's People

Contributors

lebron1992 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.