Giter VIP home page Giter VIP logo

yep's Introduction

#Yep

A community where genius meet

https://soyep.com

Yep 代码入门指南

请使用最新的 Cocoapods(version 0.39.0)进行编译并运行。

Intro

Yep 是一款非常小巧而轻量化的社交 App,围绕「遇见天才」这个主题,让用户去找到领域中的精英或者是正在一起学习的人。

Yep 的底层的架构也非常得清晰易懂,是我们经常使用的 MVC 架构。在文件中分别对应了 Realm/Models.swiftViews 文件夹以及 ViewControllers 文件夹。下面让我们一起了解一下 Yep 的工程目录。

Model

Model 层使用了 Realm 做数据持久化处理。所对应的 Realm/Models.swift 中可以看到对用户、用户技能、消息和订阅流等做了比较多的处理。对于数据库的增删改查也在该文件中有所体现,在这里不详细展开,可以直接参考代码。

UI(View & ViewController)

Yep 的整个视图跳转基本通过 Storyboard 来组织逻辑。在 Main.storyboard 中可以看到主要的界面跳转以及连接的实现方式。利用 Storyboard References 的新特性,将不同的 ViewController 分散到不同的功能文件夹的 Storyboard 中,整个 Main.storyboard 显得不再臃肿,也同时便于版本管理。

与此同时,还可以注意一下有很多的 View 都实现了 @IBDesignable,在 Interface Builder 上我们能够可视化界面的变化并且对界面进行操作。

Activity

在 Yep 中,我们使用了 MonkeyKing 来做不集成微信、微博等 SDK 而使用系统的 UIActivityViewController 的分享。使用方法非常简单,参看 Activities/WeChatActivity.swift

Service

所有的 Service 均在 Services 文件夹下。可以看到,主要的服务分为以下几大块:

  1. 用户基础操作服务(YepService.swift):登录、验证手机
  2. 消息同步操作(YepServiceSync.swift):技能、未读信息
  3. 网络请求(YepNetworking.swift):网络请求、JSON 拆解包
  4. 数据下载(YepDownloader.swift):下载音视频
  5. 消息订阅(FayeService.swift
  6. 云端存储服务(YepStorageService.swift
  7. 音视处理(YepAudioService):基于 AVFundation 和 AudioToolbox,录音、播放
  8. 位置服务(YepLocationService
  9. 社交信息服务(SocialWorkService):获取 GitHub、Dribbble 和 Instagram 的信息
  10. OpenGraphService:探测 iBooks、App、Apple Music 等信息

Performance

对于性能调优,Yep 做了对图像信息的缓存处理(Caches 文件夹)。更多性能处理可参看这个 Slide

Development

If you like to join us developing Yep, fork this repo and use git flow on develop branch to create a new branch for your developing. When you finish, send a pull request.

Please ensure each commit is minimized for code review.

yep's People

Contributors

nixzhu avatar kevinzhow avatar

Watchers

表哥的面 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.